diff --git a/libmisc/hushed.c b/libmisc/hushed.c index 327487ae..cb59a2ae 100644 --- a/libmisc/hushed.c +++ b/libmisc/hushed.c @@ -82,7 +82,7 @@ bool hushed (const struct passwd *pw) if (NULL == fp) { return false; } - for (found = false; !found && (fgets (buf, sizeof buf, fp) != NULL);) { + for (found = false; !found && (fgets (buf, sizeof buf, fp) == buf);) { buf[strlen (buf) - 1] = '\0'; found = (strcmp (buf, pw->pw_shell) == 0) || (strcmp (buf, pw->pw_name) == 0);