diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-03-21 22:32:57 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-03-21 22:32:57 +0000 |
commit | d67b2b05efca2a57f7f25e521450c200ef38803e (patch) | |
tree | af12b114d51e9ae7a8753baf09feb9ab8d654f26 /sfdisk.c | |
parent | cfe2ce6d7262d074b6fe0c1dea4d96df37e8a9ef (diff) | |
download | busybox-w32-d67b2b05efca2a57f7f25e521450c200ef38803e.tar.gz busybox-w32-d67b2b05efca2a57f7f25e521450c200ef38803e.tar.bz2 busybox-w32-d67b2b05efca2a57f7f25e521450c200ef38803e.zip |
* all mallocs now use xmalloc (and so are OOM error safe), and
the common error handling saves a few bytes. Thanks to
Bob Tinsley <bob@earthrise.demon.co.uk> for the patch.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@416 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sfdisk.c')
-rw-r--r-- | sfdisk.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -300,8 +300,7 @@ static struct sector *get_sector(char *dev, int fd, unsigned long sno) | |||
300 | if (!sseek(dev, fd, sno)) | 300 | if (!sseek(dev, fd, sno)) |
301 | return 0; | 301 | return 0; |
302 | 302 | ||
303 | if (!(s = (struct sector *) malloc(sizeof(struct sector)))) | 303 | s = (struct sector *) xmalloc(sizeof(struct sector)); |
304 | fatalError("out of memory - giving up\n"); | ||
305 | 304 | ||
306 | if (read(fd, s->data, sizeof(s->data)) != sizeof(s->data)) { | 305 | if (read(fd, s->data, sizeof(s->data)) != sizeof(s->data)) { |
307 | perror("read"); | 306 | perror("read"); |