X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fiwinfo%2Fsrc%2Fiwinfo_lualib.h;h=f7eba149d1e020a2e203d2cc84b9e7ef0ec6accb;hp=410a084f35d33e9b30ed2a53a26197fcf69883e3;hb=47dc4ded767f863f03279bc099d28ba0f0661c2a;hpb=87460e8a05faef9c4bb2c68735eef4f5c5ac15d0 diff --git a/libs/iwinfo/src/iwinfo_lualib.h b/libs/iwinfo/src/iwinfo_lualib.h index 410a084f3..f7eba149d 100644 --- a/libs/iwinfo/src/iwinfo_lualib.h +++ b/libs/iwinfo/src/iwinfo_lualib.h @@ -35,7 +35,7 @@ { #op, iwinfo_L_##type##_##op } #define LUA_WRAP_INT(type,op) \ - int iwinfo_L_##type##_##op(lua_State *L) \ + static int iwinfo_L_##type##_##op(lua_State *L) \ { \ const char *ifname = luaL_checkstring(L, 1); \ int rv; \ @@ -47,10 +47,11 @@ } #define LUA_WRAP_STRING(type,op) \ - int iwinfo_L_##type##_##op(lua_State *L) \ + static int iwinfo_L_##type##_##op(lua_State *L) \ { \ const char *ifname = luaL_checkstring(L, 1); \ char rv[IWINFO_BUFSIZE]; \ + memset(rv, 0, IWINFO_BUFSIZE); \ if( !type##_get_##op(ifname, rv) ) \ lua_pushstring(L, rv); \ else \ @@ -58,11 +59,10 @@ return 1; \ } -#define LUA_WRAP_ASSOCLIST(type) \ - int iwinfo_L_##type##_assoclist(lua_State *L) \ +#define LUA_WRAP_LIST(type,op) \ + static int iwinfo_L_##type##_##op(lua_State *L) \ { \ - return iwinfo_L_assoclist(L, \ - type##_get_assoclist); \ + return iwinfo_L_##op(L, type##_get_##op); \ } #endif