aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-02-19 03:18:10 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-02-19 03:18:10 +0100
commit030db26ad3887b8d4b33e8eb98dfdbd146fa7509 (patch)
treeb78c23cf6ea9ef7287275fe8ba194e406b6db206 /test
parent2bc4deacdc634d80cf555dabea05fc16026b6bc4 (diff)
downloadcalcurse-030db26ad3887b8d4b33e8eb98dfdbd146fa7509.tar.gz
calcurse-030db26ad3887b8d4b33e8eb98dfdbd146fa7509.zip
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'test')
-rw-r--r--test/run-test.c4
1 files 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;