summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2012-01-12 18:35:08 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2012-01-12 18:35:08 +0000
commit19239fae2dbe1cf8521608f486129207c003ca3b (patch)
tree48fae3281a457564b5d38b4c728e279c9e16bd3c
parentdfc46f2376dcbe8a887443563b067e542e79baad (diff)
fgets(3) returns a pointer, so compare against NULL, not integer 0.
from Michael W. Bombardieri ok miod@
-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 b8e646dfcc1..f9acc4d02e3 100644
--- a/usr.sbin/user/user.c
+++ b/usr.sbin/user/user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: user.c,v 1.86 2011/12/31 14:05:51 ajacoutot Exp $ */
+/* $OpenBSD: user.c,v 1.87 2012/01/12 18:35:07 ajacoutot Exp $ */
/* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */
/*
@@ -1238,7 +1238,7 @@ rm_user_from_groups(char *login_name)
login_name, f);
return 0;
}
- while (fgets(buf, sizeof(buf), from) > 0) {
+ while (fgets(buf, sizeof(buf), from) != NULL) {
cc = strlen(buf);
if (cc > 0 && buf[cc - 1] != '\n' && !feof(from)) {
while (fgetc(from) != '\n' && !feof(from))