aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-06-11 22:24:15 +0000
committerMike Frysinger <vapier@gentoo.org>2005-06-11 22:24:15 +0000
commit2401ce5343f5e553ff06fc2e621a316ee485dd39 (patch)
tree8783db369b6b22bf3de7d09ed052beb02ba506dc
parent958fa2a9cc76d92b9405276e4f017bf5af7afe8b (diff)
downloadbusybox-w32-2401ce5343f5e553ff06fc2e621a316ee485dd39.tar.gz
busybox-w32-2401ce5343f5e553ff06fc2e621a316ee485dd39.tar.bz2
busybox-w32-2401ce5343f5e553ff06fc2e621a316ee485dd39.zip
use xmalloc() and bb_perror_msg_and_die()
-rw-r--r--e2fsprogs/mke2fs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/e2fsprogs/mke2fs.c b/e2fsprogs/mke2fs.c
index 6750867cf..f77cfbcde 100644
--- a/e2fsprogs/mke2fs.c
+++ b/e2fsprogs/mke2fs.c
@@ -547,12 +547,7 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect)
547 int retval; 547 int retval;
548 unsigned int *magic; 548 unsigned int *magic;
549 549
550 buf = malloc(512*nsect); 550 buf = xmalloc(512*nsect);
551 if (!buf) {
552 printf(_("Out of memory erasing sectors %d-%d\n"),
553 sect, sect + nsect - 1);
554 exit(1);
555 }
556 551
557 if (sect == 0) { 552 if (sect == 0) {
558 /* Check for a BSD disklabel, and don't erase it if so */ 553 /* Check for a BSD disklabel, and don't erase it if so */
@@ -838,7 +833,7 @@ static void PRS(int argc, char *argv[])
838 if (oldpath) { 833 if (oldpath) {
839 char *newpath; 834 char *newpath;
840 835
841 newpath = malloc(sizeof (PATH_SET) + 1 + strlen (oldpath)); 836 newpath = xmalloc(sizeof (PATH_SET) + 1 + strlen (oldpath));
842 strcpy (newpath, PATH_SET); 837 strcpy (newpath, PATH_SET);
843 strcat (newpath, ":"); 838 strcat (newpath, ":");
844 strcat (newpath, oldpath); 839 strcat (newpath, oldpath);
@@ -872,8 +867,7 @@ static void PRS(int argc, char *argv[])
872 867
873#ifdef __linux__ 868#ifdef __linux__
874 if (uname(&ut)) { 869 if (uname(&ut)) {
875 perror("uname"); 870 bb_perror_msg_and_die("uname");
876 exit(1);
877 } 871 }
878 linux_version_code = parse_version_number(ut.release); 872 linux_version_code = parse_version_number(ut.release);
879 if (linux_version_code && linux_version_code < (2*65536 + 2*256)) { 873 if (linux_version_code && linux_version_code < (2*65536 + 2*256)) {