From 210008b3130591ff79d2d5024ffeaba6feea47ff Mon Sep 17 00:00:00 2001 From: jsing Date: Mon, 9 Jun 2014 13:13:48 +0000 Subject: Use calloc() instead of malloc()/memset(). From Benjamin Baier. --- usr.sbin/installboot/i386_softraid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.sbin/installboot/i386_softraid.c') diff --git a/usr.sbin/installboot/i386_softraid.c b/usr.sbin/installboot/i386_softraid.c index c2409744fda..a5a05807387 100644 --- a/usr.sbin/installboot/i386_softraid.c +++ b/usr.sbin/installboot/i386_softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i386_softraid.c,v 1.1 2014/01/19 02:58:50 jsing Exp $ */ +/* $OpenBSD: i386_softraid.c,v 1.2 2014/06/09 13:13:48 jsing Exp $ */ /* * Copyright (c) 2012 Joel Sing * @@ -129,11 +129,10 @@ sr_install_bootldr(int devfd, char *dev) inodeblk = nblocks - 1; bootsize = nblocks * SR_FS_BLOCKSIZE; - p = malloc(bootsize); + p = calloc(1, bootsize); if (p == NULL) err(1, NULL); - memset(p, 0, bootsize); fd = open(stage2, O_RDONLY, 0); if (fd == -1) err(1, NULL); -- cgit v1.2.3-59-g8ed1b