diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-03-05 17:52:46 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-03-05 17:52:46 +0000 |
commit | 9ca54da8398f055d2aa611cfbc29c06198748b34 (patch) | |
tree | c080f78a1a0fe2ff14ce5c4f429baca9ea41ad40 /package/iwinfo/src/iwinfo_cli.c | |
parent | f4c4e108b208aea1dd48abaef347496ca31e71cf (diff) |
[package] iwinfo: fix integer overflow in assoclist rate reporting (#11073)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30825 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iwinfo/src/iwinfo_cli.c')
-rw-r--r-- | package/iwinfo/src/iwinfo_cli.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/package/iwinfo/src/iwinfo_cli.c b/package/iwinfo/src/iwinfo_cli.c index 0fdb21ec67..7ec5aef95c 100644 --- a/package/iwinfo/src/iwinfo_cli.c +++ b/package/iwinfo/src/iwinfo_cli.c @@ -134,7 +134,8 @@ static char * format_rate(int rate) if (rate <= 0) snprintf(buf, sizeof(buf), "unknown"); else - snprintf(buf, sizeof(buf), "%.1f MBit/s", ((float)rate / 1000.0)); + snprintf(buf, sizeof(buf), "%d.%d MBit/s", + rate / 1000, (rate % 1000) / 100); return buf; } |