sscanf pattern is %Lu not %llu for long long unsigned byte counters.
authorBernd Eckenfels <net-tools@lina.inka.de>
Sat, 10 Nov 2001 17:10:01 +0000 (17:10 +0000)
committerBernd Eckenfels <net-tools@lina.inka.de>
Sat, 10 Nov 2001 17:10:01 +0000 (17:10 +0000)
This fixes the 0 byte output of ifconfig/netstat -i

lib/interface.c

index cf31b27..94cae60 100644 (file)
@@ -7,7 +7,7 @@
    8/2000  Andi Kleen make the list operations a bit more efficient.
    People are crazy enough to use thousands of aliases now.
 
-   $Id: interface.c,v 1.17 2001/08/09 15:52:39 ak Exp $
+   $Id: interface.c,v 1.18 2001/11/10 17:10:01 ecki Exp $
  */
 
 #include "config.h"
@@ -239,7 +239,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
     switch (procnetdev_vsn) {
     case 3:
        sscanf(bp,
-       "%llu %llu %lu %lu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu %lu",
+       "%Lu %Lu %lu %lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu %lu",
               &ife->stats.rx_bytes,
               &ife->stats.rx_packets,
               &ife->stats.rx_errors,
@@ -259,7 +259,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
               &ife->stats.tx_compressed);
        break;
     case 2:
-       sscanf(bp, "%llu %llu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu",
+       sscanf(bp, "%Lu %Lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu",
               &ife->stats.rx_bytes,
               &ife->stats.rx_packets,
               &ife->stats.rx_errors,
@@ -277,7 +277,7 @@ static int get_dev_fields(char *bp, struct interface *ife)
        ife->stats.rx_multicast = 0;
        break;
     case 1:
-       sscanf(bp, "%llu %lu %lu %lu %lu %llu %lu %lu %lu %lu %lu",
+       sscanf(bp, "%Lu %lu %lu %lu %lu %Lu %lu %lu %lu %lu %lu",
               &ife->stats.rx_packets,
               &ife->stats.rx_errors,
               &ife->stats.rx_dropped,