diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-05-28 00:52:26 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-05-28 00:52:26 +0000 |
commit | 83758220ae125618cab5108265b586ac5f47baf7 (patch) | |
tree | e2a02c9c41ad320c91548602ecc69db39f99ce06 /package/iwinfo/src/iwinfo_lua.c | |
parent | 022fa36b40b02248436584cf0f71bb26d79eb644 (diff) | |
download | mtk-20170518-83758220ae125618cab5108265b586ac5f47baf7.zip mtk-20170518-83758220ae125618cab5108265b586ac5f47baf7.tar.gz mtk-20170518-83758220ae125618cab5108265b586ac5f47baf7.tar.bz2 |
iwinfo: assume that no tx power information is available if nl80211 returns 0 dBm maximum
SVN-Revision: 31932
Diffstat (limited to 'package/iwinfo/src/iwinfo_lua.c')
-rw-r--r-- | package/iwinfo/src/iwinfo_lua.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/package/iwinfo/src/iwinfo_lua.c b/package/iwinfo/src/iwinfo_lua.c index e4435c1..bd8faf9 100644 --- a/package/iwinfo/src/iwinfo_lua.c +++ b/package/iwinfo/src/iwinfo_lua.c @@ -332,11 +332,12 @@ static int iwinfo_L_txpwrlist(lua_State *L, int (*func)(const char *, char *, in const char *ifname = luaL_checkstring(L, 1); struct iwinfo_txpwrlist_entry *e; - lua_newtable(L); memset(rv, 0, sizeof(rv)); if (!(*func)(ifname, rv, &len)) { + lua_newtable(L); + for (i = 0, x = 1; i < len; i += sizeof(struct iwinfo_txpwrlist_entry), x++) { e = (struct iwinfo_txpwrlist_entry *) &rv[i]; @@ -351,9 +352,11 @@ static int iwinfo_L_txpwrlist(lua_State *L, int (*func)(const char *, char *, in lua_rawseti(L, -2, x); } + + return 1; } - return 1; + return 0; } /* Wrapper for scan list */ |