From: nekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Date: Fri, 12 Jun 2009 20:20:45 +0000 (+0000)
Subject: 	* lib/fputsx.c: Compare the result of fgets() with the provided
X-Git-Tag: 4.1.4.2~17
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bbb2a1522f799ebdd252a98f5cb6058b5286540f;p=shadow

	* lib/fputsx.c: Compare the result of fgets() with the provided
	buffer instead of NULL.
---

diff --git a/ChangeLog b/ChangeLog
index 7eb18b8e..5b41c7f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2009-06-11  Nicolas François  <nicolas.francois@centraliens.net>
+2009-06-12  Nicolas François  <nicolas.francois@centraliens.net>
+
+	* lib/fputsx.c: Compare the result of fgets() with the provided
+	buffer instead of NULL.
+
+2009-06-12  Nicolas François  <nicolas.francois@centraliens.net>
 
 	* 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 {