summaryrefslogtreecommitdiffstats
path: root/usr.sbin/user
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/user
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/user')
-rw-r--r--usr.sbin/user/user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c
index 2e39803df59..03de2b5e0bb 100644
--- a/usr.sbin/user/user.c
+++ b/usr.sbin/user/user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: user.c,v 1.126 2019/06/28 13:32:51 deraadt Exp $ */
+/* $OpenBSD: user.c,v 1.127 2019/07/03 03:24:03 deraadt Exp $ */
/* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */
/*
@@ -1165,7 +1165,7 @@ adduser(char *login_name, user_t *up)
if (yp) {
/* put back the + line */
cc = snprintf(buf, sizeof(buf), "+:*::::::::\n");
- if (cc == -1 || cc >= sizeof(buf)) {
+ if (cc < 0 || cc >= sizeof(buf)) {
close(ptmpfd);
pw_abort();
errx(EXIT_FAILURE, "can't add `%s', line too long", buf);