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>
This commit is contained in:
parent
2bc4deacdc
commit
030db26ad3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user