summaryrefslogtreecommitdiffhomepage
path: root/contrib/package
diff options
context:
space:
mode:
authorVasilis Tsiligiannis <b_tsiligiannis@silverton.gr>2011-02-26 22:30:52 +0000
committerVasilis Tsiligiannis <b_tsiligiannis@silverton.gr>2011-02-26 22:30:52 +0000
commitfc965936de41effba180ef7ecf60b9f14d46ad9d (patch)
tree8a28bb71a9682a26197056af71462bbabee210dd /contrib/package
parent1417ae9a98dbec2e9b2a9a2f576eedc9766e8215 (diff)
libiwinfo: Fix frequency-to-MHz coversion
Diffstat (limited to 'contrib/package')
-rw-r--r--contrib/package/iwinfo/src/iwinfo_wext.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_wext.c b/contrib/package/iwinfo/src/iwinfo_wext.c
index 518551f7d5..5b942ea33a 100644
--- a/contrib/package/iwinfo/src/iwinfo_wext.c
+++ b/contrib/package/iwinfo/src/iwinfo_wext.c
@@ -32,7 +32,7 @@ static double wext_freq2float(const struct iw_freq *in)
static inline int wext_freq2mhz(const struct iw_freq *in)
{
- int i, mhz;
+ int i;
if( in->e == 6 )
{
@@ -40,11 +40,7 @@ static inline int wext_freq2mhz(const struct iw_freq *in)
}
else
{
- mhz = in->m;
- for(i = 0; i < in->e; i++)
- mhz *= 10;
-
- return (int)(mhz / 100000);
+ return (int)(wext_freq2float(in) / 1000000);
}
}