From: Eric Blake Date: Thu, 12 May 2011 01:33:46 +0000 (-0600) Subject: test-fflush: silence compiler warning X-Git-Tag: v0.1~2791 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=4104cd4f7746f8ba7e75e3292c78c2c528b0c88a;p=gnulib.git test-fflush: silence compiler warning Detected by clang. * tests/test-fflush.c (main): Don't fclose a NULL pointer. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 1ce48bb10..34ccc1067 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-05-11 Eric Blake + + test-fflush: silence compiler warning + * tests/test-fflush.c (main): Don't fclose a NULL pointer. + 2011-05-11 Bruno Haible canonicalize, canonicalize-lgpl: Avoid crash dialog on MacOS X. diff --git a/tests/test-fflush.c b/tests/test-fflush.c index 3c36ed901..a6c0e18ab 100644 --- a/tests/test-fflush.c +++ b/tests/test-fflush.c @@ -50,7 +50,8 @@ main (void) if (!f || 0 > fd || fread (buffer, 1, 5, f) != 5) { fputs ("Failed initial read of sample file.\n", stderr); - fclose (f); + if (f) + fclose (f); unlink ("test-fflush.txt"); return 1; }