diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-03-29 22:34:47 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-03-29 22:34:47 +0000 |
commit | d409c3a2f787dd2276d242d70e03b25e33436cea (patch) | |
tree | adec7d9142ff4899bb9d0319bbbd5822359fbc0b /networking | |
parent | abaef6565e03b03fb750c7935737fd0309395729 (diff) | |
download | busybox-w32-d409c3a2f787dd2276d242d70e03b25e33436cea.tar.gz busybox-w32-d409c3a2f787dd2276d242d70e03b25e33436cea.tar.bz2 busybox-w32-d409c3a2f787dd2276d242d70e03b25e33436cea.zip |
- Rich Felker writes: fix invalid printf format strings
http://busybox.net/lists/busybox/2006-March/019568.html
text data bss dec hex filename
900619 10316 1038724 1949659 1dbfdb busybox.oorig
900603 10316 1038724 1949643 1dbfcb busybox
Diffstat (limited to 'networking')
-rw-r--r-- | networking/interface.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/networking/interface.c b/networking/interface.c index 0c395272f..e1af2bf19 100644 --- a/networking/interface.c +++ b/networking/interface.c | |||
@@ -1038,23 +1038,23 @@ static char *get_name(char *name, char *p) | |||
1038 | * args. */ | 1038 | * args. */ |
1039 | 1039 | ||
1040 | /* static const char * const ss_fmt[] = { */ | 1040 | /* static const char * const ss_fmt[] = { */ |
1041 | /* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */ | 1041 | /* "%lln%llu%lu%lu%lu%lu%ln%ln%lln%llu%lu%lu%lu%lu%lu", */ |
1042 | /* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */ | 1042 | /* "%llu%llu%lu%lu%lu%lu%ln%ln%llu%llu%lu%lu%lu%lu%lu", */ |
1043 | /* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */ | 1043 | /* "%llu%llu%lu%lu%lu%lu%lu%lu%llu%llu%lu%lu%lu%lu%lu%lu" */ |
1044 | /* }; */ | 1044 | /* }; */ |
1045 | 1045 | ||
1046 | /* Lie about the size of the int pointed to for %n. */ | 1046 | /* Lie about the size of the int pointed to for %n. */ |
1047 | #if INT_MAX == LONG_MAX | 1047 | #if INT_MAX == LONG_MAX |
1048 | static const char * const ss_fmt[] = { | 1048 | static const char * const ss_fmt[] = { |
1049 | "%n%Lu%u%u%u%u%n%n%n%Lu%u%u%u%u%u", | 1049 | "%n%llu%u%u%u%u%n%n%n%llu%u%u%u%u%u", |
1050 | "%Lu%Lu%u%u%u%u%n%n%Lu%Lu%u%u%u%u%u", | 1050 | "%llu%llu%u%u%u%u%n%n%llu%llu%u%u%u%u%u", |
1051 | "%Lu%Lu%u%u%u%u%u%u%Lu%Lu%u%u%u%u%u%u" | 1051 | "%llu%llu%u%u%u%u%u%u%llu%llu%u%u%u%u%u%u" |
1052 | }; | 1052 | }; |
1053 | #else | 1053 | #else |
1054 | static const char * const ss_fmt[] = { | 1054 | static const char * const ss_fmt[] = { |
1055 | "%n%Lu%lu%lu%lu%lu%n%n%n%Lu%lu%lu%lu%lu%lu", | 1055 | "%n%llu%lu%lu%lu%lu%n%n%n%llu%lu%lu%lu%lu%lu", |
1056 | "%Lu%Lu%lu%lu%lu%lu%n%n%Lu%Lu%lu%lu%lu%lu%lu", | 1056 | "%llu%llu%lu%lu%lu%lu%n%n%llu%llu%lu%lu%lu%lu%lu", |
1057 | "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" | 1057 | "%llu%llu%lu%lu%lu%lu%lu%lu%llu%llu%lu%lu%lu%lu%lu%lu" |
1058 | }; | 1058 | }; |
1059 | 1059 | ||
1060 | #endif | 1060 | #endif |
@@ -1748,7 +1748,7 @@ static void print_bytes_scaled(unsigned long long ull, const char *end) | |||
1748 | #endif | 1748 | #endif |
1749 | } while (i); | 1749 | } while (i); |
1750 | 1750 | ||
1751 | printf("X bytes:%Lu (%Lu.%u %sB)%s", ull, int_part, frac_part, ext, end); | 1751 | printf("X bytes:%llu (%llu.%u %sB)%s", ull, int_part, frac_part, ext, end); |
1752 | } | 1752 | } |
1753 | 1753 | ||
1754 | static const char * const ife_print_flags_strs[] = { | 1754 | static const char * const ife_print_flags_strs[] = { |
@@ -1989,23 +1989,23 @@ static void ife_print(struct interface *ptr) | |||
1989 | */ | 1989 | */ |
1990 | printf(" "); | 1990 | printf(" "); |
1991 | 1991 | ||
1992 | printf(_("RX packets:%Lu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"), | 1992 | printf("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n", |
1993 | ptr->stats.rx_packets, ptr->stats.rx_errors, | 1993 | ptr->stats.rx_packets, ptr->stats.rx_errors, |
1994 | ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors, | 1994 | ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors, |
1995 | ptr->stats.rx_frame_errors); | 1995 | ptr->stats.rx_frame_errors); |
1996 | if (can_compress) | 1996 | if (can_compress) |
1997 | printf(_(" compressed:%lu\n"), | 1997 | printf(" compressed:%lu\n", |
1998 | ptr->stats.rx_compressed); | 1998 | ptr->stats.rx_compressed); |
1999 | printf(" "); | 1999 | printf(" "); |
2000 | printf(_("TX packets:%Lu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"), | 2000 | printf("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n", |
2001 | ptr->stats.tx_packets, ptr->stats.tx_errors, | 2001 | ptr->stats.tx_packets, ptr->stats.tx_errors, |
2002 | ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors, | 2002 | ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors, |
2003 | ptr->stats.tx_carrier_errors); | 2003 | ptr->stats.tx_carrier_errors); |
2004 | printf(_(" collisions:%lu "), ptr->stats.collisions); | 2004 | printf(" collisions:%lu "), ptr->stats.collisions; |
2005 | if (can_compress) | 2005 | if (can_compress) |
2006 | printf(_("compressed:%lu "), ptr->stats.tx_compressed); | 2006 | printf("compressed:%lu ", ptr->stats.tx_compressed); |
2007 | if (ptr->tx_queue_len != -1) | 2007 | if (ptr->tx_queue_len != -1) |
2008 | printf(_("txqueuelen:%d "), ptr->tx_queue_len); | 2008 | printf("txqueuelen:%d ", ptr->tx_queue_len); |
2009 | printf("\n R"); | 2009 | printf("\n R"); |
2010 | print_bytes_scaled(ptr->stats.rx_bytes, " T"); | 2010 | print_bytes_scaled(ptr->stats.rx_bytes, " T"); |
2011 | print_bytes_scaled(ptr->stats.tx_bytes, "\n"); | 2011 | print_bytes_scaled(ptr->stats.tx_bytes, "\n"); |