From: Sami Kerola Date: Mon, 11 Jul 2011 16:01:24 +0000 (+0200) Subject: fdformat: use xalloc.h X-Git-Tag: v2.20-rc1~86^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a53b31d0bd8ec5d23d2a250b2f45143be83ee02e;p=thirdparty%2Futil-linux.git fdformat: use xalloc.h Signed-off-by: Sami Kerola --- diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c index d525f53023..3d3512200c 100644 --- a/disk-utils/fdformat.c +++ b/disk-utils/fdformat.c @@ -19,6 +19,7 @@ #include "c.h" #include "nls.h" +#include "xalloc.h" struct floppy_struct param; @@ -60,8 +61,7 @@ static void verify_disk(char *name) int fd,cyl_size,count; cyl_size = param.sect*param.head*512; - if ((data = (unsigned char *) malloc(cyl_size)) == NULL) - err(EXIT_FAILURE, "malloc"); + data = xmalloc(cyl_size); printf(_("Verifying ... ")); fflush(stdout); if ((fd = open(name,O_RDONLY)) < 0)