summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/iwinfo/src/iwinfo_wext.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/iwinfo/src/iwinfo_wext.c b/libs/iwinfo/src/iwinfo_wext.c
index eebaea6af..2a1b685c4 100644
--- a/libs/iwinfo/src/iwinfo_wext.c
+++ b/libs/iwinfo/src/iwinfo_wext.c
@@ -373,17 +373,18 @@ int wext_get_txpwrlist(const char *ifname, char *buf, int *len)
) {
for( i = 0; i < range.num_txpower; i++ )
{
- if( range.txpower_capa & IW_TXPOW_MWATT )
- {
- entry.dbm = wext_mw2dbm(range.txpower[i]);
- entry.mw = range.txpower[i];
- }
- else
+ if( range.txpower_capa & IW_TXPOW_DBM )
{
entry.dbm = range.txpower[i];
entry.mw = wext_dbm2mw(range.txpower[i]);
}
+ else if( range.txpower_capa & IW_TXPOW_MWATT )
+ {
+ entry.dbm = wext_mw2dbm(range.txpower[i]);
+ entry.mw = range.txpower[i];
+ }
+
memcpy(&buf[i*sizeof(entry)], &entry, sizeof(entry));
}