From bbb2a1522f799ebdd252a98f5cb6058b5286540f Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Fri, 12 Jun 2009 20:20:45 +0000 Subject: [PATCH] * lib/fputsx.c: Compare the result of fgets() with the provided buffer instead of NULL. --- ChangeLog | 7 ++++++- lib/fputsx.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7eb18b8e..5b41c7f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2009-06-11 Nicolas François +2009-06-12 Nicolas François + + * lib/fputsx.c: Compare the result of fgets() with the provided + buffer instead of NULL. + +2009-06-12 Nicolas François * lib/gshadow.c: Removed limitation on the length of the gshadow lines. diff --git a/lib/fputsx.c b/lib/fputsx.c index 9a55ba0e..c42b40bd 100644 --- a/lib/fputsx.c +++ b/lib/fputsx.c @@ -45,7 +45,7 @@ char *ep; while (cnt > 0) { - if (fgets (cp, cnt, f) == 0) { + if (fgets (cp, cnt, f) != cp) { if (cp == buf) { return 0; } else {