summaryrefslogtreecommitdiff
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-02-05 02:17:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-02-05 02:17:33 +0000
commitaa13d2ec5555dbfdc371f1d865cddc5c3de5728e (patch)
tree4ed61809a72e33940f8487544c5fe67f3e30ee0b /usr.sbin/config
parent7406246b8f0f96fc7d5884c1eba639bc65489ed2 (diff)
dev_t is signed to permit passing -1 as an invalid condition, but the
decomposition into major and minor is unsigned, so we should print them with %u instead of %d. ok guenther
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/mkswap.c4
-rw-r--r--usr.sbin/config/sem.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/config/mkswap.c b/usr.sbin/config/mkswap.c
index ddd94d31ba3..645340c5e4f 100644
--- a/usr.sbin/config/mkswap.c
+++ b/usr.sbin/config/mkswap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkswap.c,v 1.16 2016/10/16 17:50:00 tb Exp $ */
+/* $OpenBSD: mkswap.c,v 1.17 2019/02/05 02:17:32 deraadt Exp $ */
/* $NetBSD: mkswap.c,v 1.5 1996/08/31 20:58:27 mycroft Exp $ */
/*
@@ -76,7 +76,7 @@ mkdevstr(dev_t d)
if (d == NODEV)
(void)snprintf(buf, sizeof buf, "NODEV");
else
- (void)snprintf(buf, sizeof buf, "makedev(%d, %d)",
+ (void)snprintf(buf, sizeof buf, "makedev(%u, %u)",
major(d), minor(d));
return buf;
}
diff --git a/usr.sbin/config/sem.c b/usr.sbin/config/sem.c
index 9fdce78936d..a6c6611e531 100644
--- a/usr.sbin/config/sem.c
+++ b/usr.sbin/config/sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sem.c,v 1.36 2015/12/14 05:59:56 mmcc Exp $ */
+/* $OpenBSD: sem.c,v 1.37 2019/02/05 02:17:32 deraadt Exp $ */
/* $NetBSD: sem.c,v 1.10 1996/11/11 23:40:11 gwr Exp $ */
/*
@@ -550,10 +550,10 @@ resolve(struct nvlist **nvp, const char *name, const char *what,
if (dev->d_major == maj)
break;
if (dev == NULL)
- (void)snprintf(buf, sizeof buf, "<%d/%d>",
+ (void)snprintf(buf, sizeof buf, "<%u/%u>",
maj, min);
else
- (void)snprintf(buf, sizeof buf, "%s%d%c",
+ (void)snprintf(buf, sizeof buf, "%s%u%c",
dev->d_name, min / maxpartitions,
(min % maxpartitions) + 'a');
nv->nv_str = intern(buf);