Menu

#6 UDP stats scanf has too many arguments

v1.0 (example)
open
Tim Cook
None
5
2014-09-30
2014-09-30
No

The following patch fixes this compiler warning:

nicstat.c: In function ‘load_snmp’:
nicstat.c:1569:8: warning: too many arguments for format [-Wformat-extra-args]

diff --git a/nicstat.c b/nicstat.c
index b2fd5f6..33e8e75 100644
--- a/nicstat.c
+++ b/nicstat.c
@@ -1566,7 +1566,7 @@ load_snmp(FILE *snmp)
                        n = fscanf(snmp, "Udp: %lld %lld %lld %lld "
                            "%lld %lld\n",
                            &ll[0], &ll[1], &ll[2], &ll[3],
-                           &ll[4], &ll[5], &ll[6]);
+                           &ll[4], &ll[5]);
                        if (n == 6) {
                                g_udp_new->inDatagrams = ll[0];
                                g_udp_new->outDatagrams = ll[3];

Fixing in my fork https://github.com/scotte/nicstat along with the other bugs here.

Discussion


Log in to post a comment.