diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-11-02 11:06:55 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-11-02 11:06:55 +0000 |
commit | f20108e2f0f80c4d6b654b26befd314a5db05ef0 (patch) | |
tree | 98299097110633b9fc3a160c5638952345275a80 | |
parent | d55f46ae8327ffe720da569b8643feb949a2d3c2 (diff) |
Use emalloc, like in the rest of makefs
From Michael W. Bombardieri
-rw-r--r-- | usr.sbin/makefs/msdos/mkfs_msdos.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/makefs/msdos/mkfs_msdos.c b/usr.sbin/makefs/msdos/mkfs_msdos.c index cd291d8a5c5..7fbcca01750 100644 --- a/usr.sbin/makefs/msdos/mkfs_msdos.c +++ b/usr.sbin/makefs/msdos/mkfs_msdos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkfs_msdos.c,v 1.4 2017/03/28 00:08:39 jsg Exp $ */ +/* $OpenBSD: mkfs_msdos.c,v 1.5 2017/11/02 11:06:54 jca Exp $ */ /* $NetBSD: mkfs_msdos.c,v 1.10 2016/04/03 11:00:13 mlelstv Exp $ */ /* @@ -48,6 +48,7 @@ #include <util.h> #include <disktab.h> +#include "makefs.h" #include "msdos/mkfs_msdos.h" #define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ @@ -592,8 +593,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op) gettimeofday(&tv, NULL); now = tv.tv_sec; tm = localtime(&now); - if (!(img = malloc(bpb.bps))) - err(1, NULL); + img = emalloc(bpb.bps); dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft; signal(SIGINFO, infohandler); for (lsn = 0; lsn < dir + (o.fat_type == 32 ? bpb.spc : rds); lsn++) { |