From 030db26ad3887b8d4b33e8eb98dfdbd146fa7509 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 19 Feb 2012 03:18:10 +0100 Subject: test/run-test.c: Check fgets() return value properly Not sure what we were doing here. fgets() returns a pointer, not an integer! Signed-off-by: Lukas Fleischer --- test/run-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/run-test.c b/test/run-test.c index be9f1ce..99ba56c 100644 --- a/test/run-test.c +++ b/test/run-test.c @@ -191,9 +191,9 @@ run_test (const char *name, int expect_failure) fpin1 = fdopen (pin1, "r"); fpin2 = fdopen (pin2, "r"); - while (fgets (buf1, BUFSIZ, fpin1) > 0) + while (fgets (buf1, BUFSIZ, fpin1)) { - if (fgets (buf2, BUFSIZ, fpin2) <= 0 || strcmp (buf1, buf2) != 0) + if (!fgets (buf2, BUFSIZ, fpin2) || strcmp (buf1, buf2) != 0) { ret = 0; break; -- cgit v1.2.3-70-g09d2