[pisa-src] r1322 - trunk/libpisa/util.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 27 Oct 2009 15:10:21 +0100

Author: tjansen
Date: Tue Oct 27 15:10:20 2009
New Revision: 1322

Log:
Fixed warning:

util.c: In function ‘pisa_read_nameserver’:
util.c:781: warning: ignoring return value of ‘fread’, declared with attribute 
warn_unused_result

Modified:
   trunk/libpisa/util.c

Modified: trunk/libpisa/util.c
==============================================================================
--- trunk/libpisa/util.c        Tue Oct 27 15:09:52 2009        (r1321)
+++ trunk/libpisa/util.c        Tue Oct 27 15:10:20 2009        (r1322)
@@ -778,7 +778,10 @@
                PISA_ERROR("pisa_read_nameserver: popen failed.\n");
                return -1;
        }
-       fread(buf, sizeof(buf), 1, f);
+       if (!fread(buf, sizeof(buf), 1, f)) {
+               PISA_ERROR("pisa_read_nameserver: fread failed.\n");
+               return -1;
+       }
        pclose(f);
 
        /* Convert the result into struct in_addr type, and return it. */

Other related posts:

  • » [pisa-src] r1322 - trunk/libpisa/util.c - Thomas Jansen