summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-07-03 03:24:01 +0000
committerderaadt <deraadt@openbsd.org>2019-07-03 03:24:01 +0000
commit515e489c3d599b9cfcdf9cf6842ac49f92e154d6 (patch)
tree9ce211473951e1baf5c99e08c2c35012292670f1 /usr.sbin/installboot
parentsync (diff)
downloadwireguard-openbsd-515e489c3d599b9cfcdf9cf6842ac49f92e154d6.tar.xz
wireguard-openbsd-515e489c3d599b9cfcdf9cf6842ac49f92e154d6.zip
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'usr.sbin/installboot')
-rw-r--r--usr.sbin/installboot/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/installboot/util.c b/usr.sbin/installboot/util.c
index 305362f3a1c..ba5ee2f0e9c 100644
--- a/usr.sbin/installboot/util.c
+++ b/usr.sbin/installboot/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.13 2018/11/07 04:51:56 miko Exp $ */
+/* $OpenBSD: util.c,v 1.14 2019/07/03 03:24:03 deraadt Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
@@ -107,7 +107,7 @@ fileprefix(const char *base, const char *path)
return (NULL);
}
n = snprintf(s, PATH_MAX, "%s/%s", base, path);
- if (n < 1 || n >= PATH_MAX) {
+ if (n < 0 || n >= PATH_MAX) {
warn("snprintf");
goto err;
}
@@ -124,7 +124,7 @@ fileprefix(const char *base, const char *path)
goto err;
}
n = snprintf(s, PATH_MAX, "%s/%s", r, b);
- if (n < 1 || n >= PATH_MAX) {
+ if (n < 0 || n >= PATH_MAX) {
warn("snprintf");
goto err;
}