diff options
author | jca <jca@openbsd.org> | 2017-11-02 11:06:54 +0000 |
---|---|---|
committer | jca <jca@openbsd.org> | 2017-11-02 11:06:54 +0000 |
commit | 2544950e2a101f5b2a148acb665716a7f08a1089 (patch) | |
tree | a9b72e937da0bc9fed28f5049e646312eede7e1a /usr.sbin/makefs | |
parent | Straightforward conversion to strtonum. Slight change of behavior in that (diff) | |
download | wireguard-openbsd-2544950e2a101f5b2a148acb665716a7f08a1089.tar.xz wireguard-openbsd-2544950e2a101f5b2a148acb665716a7f08a1089.zip |
Use emalloc, like in the rest of makefs
From Michael W. Bombardieri
Diffstat (limited to 'usr.sbin/makefs')
-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++) { |