Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makefs Make memset() usage consequent in using the ...



details:   https://anonhg.NetBSD.org/src/rev/5a035018a90c
branches:  trunk
changeset: 789055:5a035018a90c
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Mon Aug 05 16:43:46 2013 +0000

description:
Make memset() usage consequent in using the right types

diffstat:

 usr.sbin/makefs/udf.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (48 lines):

diff -r e93dc0e733b3 -r 5a035018a90c usr.sbin/makefs/udf.c
--- a/usr.sbin/makefs/udf.c     Mon Aug 05 16:00:57 2013 +0000
+++ b/usr.sbin/makefs/udf.c     Mon Aug 05 16:43:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.1 2013/08/05 14:41:57 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.2 2013/08/05 16:43:46 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: udf.c,v 1.1 2013/08/05 14:41:57 reinoud Exp $");
+__RCSID("$NetBSD: udf.c,v 1.2 2013/08/05 16:43:46 reinoud Exp $");
 #endif /* not lint */
 
 #define _EXPOSE_MMC
@@ -156,7 +156,7 @@
 {
        off_t sectors;
 
-       memset(di, 0, sizeof(struct mmc_discinfo));
+       memset(di, 0, sizeof(*di));
 
        /* file support */
        if ((mmc_emuprofile != 0x01) && (fsopts->sectorsize != 2048))
@@ -592,7 +592,10 @@
        size = UDF_EXT_LEN(udf_rw32(piece->len));
 
        /* extract last entry as a long_ad */
-       memset(&last_piece, 0, sizeof(struct long_ad));
+       memset(&last_piece, 0, sizeof(last_piece));
+       last_len      = 0;
+       last_lb_num   = 0;
+       last_part_num = 0;
        if (l_ad != 0) {
                if (use_shorts) {
                        assert(cur_alloc == UDF_ICB_SHORT_ALLOC);
@@ -1183,7 +1186,7 @@
        error = 1;
 
        /* estimate the amount of space needed */
-       memset(&stats, 0, sizeof(struct udf_stats));
+       memset(&stats, 0, sizeof(stats));
        udf_enumerate_and_estimate(dir, root, fsopts, &stats);
 
        printf("Calculated size of `%s': %lld bytes, %ld inodes\n",



Home | Main Index | Thread Index | Old Index