libs/iwinfo: forgot to clear string buffer in wrapper function

This commit is contained in:
Jo-Philipp Wich 2009-08-10 00:38:02 +00:00
parent 1e4efd1355
commit a85dd8ee6e
3 changed files with 7 additions and 3 deletions

View file

@ -14,8 +14,8 @@
* *
*/ */
#ifndef _wlioctl_h_ #ifndef _BROADCOM_H
#define _wlioctl_h_ #define _BROADCOM_H
#define WL_MCSSET_LEN 16 #define WL_MCSSET_LEN 16
#define WL_MAX_STA_COUNT 32 #define WL_MAX_STA_COUNT 32
@ -73,4 +73,4 @@ typedef struct wl_ioctl {
uint32_t needed; /* bytes needed (optional) */ uint32_t needed; /* bytes needed (optional) */
} wl_ioctl_t; } wl_ioctl_t;
#endif /* _wlioctl_h_ */ #endif

View file

@ -18,6 +18,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _MADWIFI_H
#define _MADWIFI_H
/* ieee80211.h */ /* ieee80211.h */
#define IEEE80211_ADDR_LEN 6 #define IEEE80211_ADDR_LEN 6
@ -118,3 +120,4 @@ struct ieee80211req_sta_info {
u_int8_t isi_opmode; /* sta operating mode */ u_int8_t isi_opmode; /* sta operating mode */
}; };
#endif

View file

@ -51,6 +51,7 @@
{ \ { \
const char *ifname = luaL_checkstring(L, 1); \ const char *ifname = luaL_checkstring(L, 1); \
char rv[IWINFO_BUFSIZE]; \ char rv[IWINFO_BUFSIZE]; \
memset(rv, 0, IWINFO_BUFSIZE); \
if( !type##_get_##op(ifname, rv) ) \ if( !type##_get_##op(ifname, rv) ) \
lua_pushstring(L, rv); \ lua_pushstring(L, rv); \
else \ else \