summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-06-18 18:24:16 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-06-18 18:24:16 +0000
commit4b85919351e304ed64715746ad4aa57d89692f1e (patch)
tree348ad6e71169f21da083fa1197c07a5554f67920 /sbin
parentfb7a6f1919017f0c32091447bcdc5b311be459de (diff)
Initialize duid memory before shifting stuff into elements of it.
No doubt quiets one or more of the fringe compilers out there. Use variable 'part' rather than recalculating same value in the subsequent printf(). From dhill. ok otto@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/disklabel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 07e3f2cc731..8d3af18e269 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.186 2013/06/11 16:42:04 deraadt Exp $ */
+/* $OpenBSD: disklabel.c,v 1.187 2013/06/18 18:24:15 krw Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -979,6 +979,7 @@ duid_parse(struct disklabel *lp, char *s)
if (strlen(s) != 16)
return -1;
+ memset(duid, 0, sizeof(duid));
for (i = 0; i < 16; i++) {
c = s[i];
if (c >= '0' && c <= '9')
@@ -1359,8 +1360,9 @@ checklabel(struct disklabel *lp)
part = 'a' + i;
pp = &lp->d_partitions[i];
if (DL_GETPSIZE(pp) || DL_GETPOFFSET(pp))
- warnx("warning, unused partition %c: size %lld offset %lld",
- 'a' + i, DL_GETPSIZE(pp), DL_GETPOFFSET(pp));
+ warnx("warning, unused partition %c: size %lld "
+ "offset %lld", part, DL_GETPSIZE(pp),
+ DL_GETPOFFSET(pp));
}
return (errors > 0);
}