diff --git a/lib/gshadow.c b/lib/gshadow.c index 3706e50d..6a5cd67b 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -156,7 +156,7 @@ void endsgent (void) } if (fgetsx(buf, buflen, fp) == buf) { - while ( ((cp = strrchr (buf, '\n')) == NULL) + while ( (strrchr(buf, '\n') == NULL) && (feof (fp) == 0)) { size_t len;