[pisa-src] r1272 - trunk/libpisa/arp.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 22 Oct 2009 12:22:09 +0200

Author: tjansen
Date: Thu Oct 22 12:22:09 2009
New Revision: 1272

Log:
Tentative fix for warnings about unused return values in arp.c

arp.c: In function ‘pisa_arp_cache_update’:
arp.c:117: warning: ignoring return value of ‘fgets’, declared with attribute 
warn_unused_result
arp.c:120: warning: ignoring return value of ‘fgets’, declared with attribute 
warn_unused_result

As I can't reproduce the warnings, the fix is labeled as tentative.

Modified:
   trunk/libpisa/arp.c

Modified: trunk/libpisa/arp.c
==============================================================================
--- trunk/libpisa/arp.c Thu Oct 22 12:08:26 2009        (r1271)
+++ trunk/libpisa/arp.c Thu Oct 22 12:22:09 2009        (r1272)
@@ -114,10 +114,10 @@
 
        inet_ntop(AF_INET, ip, ip_str, sizeof(ip_str));
        strcat(ip_str, " ");
-       fgets(line, sizeof(line), f);
+       if (!fgets(line, sizeof(line), f))
+               return result;
 
-       while (!feof(f)) {
-               fgets(line, sizeof(line), f);
+       while (fgets(line, sizeof(line), f)) {
                if (!strncmp(ip_str, line, strlen(ip_str))) {
                        pisa_mac_parse_string(&mac, line + 41);
                        result = 0;

Other related posts:

  • » [pisa-src] r1272 - trunk/libpisa/arp.c - Thomas Jansen