summaryrefslogtreecommitdiff
path: root/sfdisk.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-21 22:32:57 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-21 22:32:57 +0000
commit0d068a20676144e9fd6796cc77764c420d785394 (patch)
treeaf12b114d51e9ae7a8753baf09feb9ab8d654f26 /sfdisk.c
parentc053e41fa0524d828bf90f47e5e3637b8facaadc (diff)
downloadbusybox-w32-0d068a20676144e9fd6796cc77764c420d785394.tar.gz
busybox-w32-0d068a20676144e9fd6796cc77764c420d785394.tar.bz2
busybox-w32-0d068a20676144e9fd6796cc77764c420d785394.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
Diffstat (limited to 'sfdisk.c')
-rw-r--r--sfdisk.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sfdisk.c b/sfdisk.c
index f23eb5611..0a740ab17 100644
--- a/sfdisk.c
+++ b/sfdisk.c
@@ -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");