diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-04-15 16:27:32 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-04-15 16:27:32 +0000 |
commit | 7e163efcebadc900f76c36054d5066bb7b496417 (patch) | |
tree | 6024bdcdfa94ef5ede0f5b3442a066ec9ca06fe8 /usr.sbin | |
parent | ddca326bed4fd9cc7cd9e6491c61ae550c89bd2e (diff) |
fix snprintf return value check. ok otto@ millert@
Diffstat (limited to 'usr.sbin')
-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 782ee7b34e8..e8456194b50 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.62 2005/04/13 03:46:28 deraadt Exp $ */ +/* $OpenBSD: user.c,v 1.63 2005/04/15 16:27:31 moritz Exp $ */ /* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */ /* @@ -1114,7 +1114,7 @@ adduser(char *login_name, user_t *up) } if (yp) { cc = snprintf(buf, sizeof(buf), "+:*::::::::\n"); - if (cc == -1 || cc > sizeof(buf)) { + if (cc == -1 || cc >= sizeof(buf)) { (void) close(ptmpfd); pw_abort(); errx(EXIT_FAILURE, "can't add `%s', line too long", buf); |