diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-07-03 03:24:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-07-03 03:24:05 +0000 |
commit | 75fca2aa3a35362ecff27f0c3041d3f511b51275 (patch) | |
tree | d0c647e96313c8d94edf3f50304b78ae1cf249c1 /usr.sbin/user/user.c | |
parent | aef6c060ee15355c0490999de3c4679d7bb97e84 (diff) |
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'usr.sbin/user/user.c')
-rw-r--r-- | usr.sbin/user/user.c | 4 |
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); |