libs/iwinfo: forgot to clear string buffer in wrapper function
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 10 Aug 2009 00:38:02 +0000 (00:38 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 10 Aug 2009 00:38:02 +0000 (00:38 +0000)
libs/iwinfo/src/include/broadcom.h
libs/iwinfo/src/include/madwifi.h
libs/iwinfo/src/iwinfo_lualib.h

index 344c1206a093a457c13acacf17d60468bd068336..ad3b5ddb1134afdc3e0a87a9c0d857fb6e62bc29 100644 (file)
@@ -14,8 +14,8 @@
  *
  */
 
-#ifndef _wlioctl_h_
-#define        _wlioctl_h_
+#ifndef _BROADCOM_H
+#define _BROADCOM_H
 
 #define WL_MCSSET_LEN                          16
 #define WL_MAX_STA_COUNT                       32
@@ -73,4 +73,4 @@ typedef struct wl_ioctl {
        uint32_t                                needed; /* bytes needed (optional) */
 } wl_ioctl_t;
 
-#endif /* _wlioctl_h_ */
+#endif
index c1eeca7754cf1e48552899d777967b665a2a3e07..fd19dbf613f49f718491495a40c7c9ee2bd5805a 100644 (file)
@@ -18,6 +18,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _MADWIFI_H
+#define _MADWIFI_H
 
 /* ieee80211.h */
 #define        IEEE80211_ADDR_LEN              6
@@ -118,3 +120,4 @@ struct ieee80211req_sta_info {
        u_int8_t isi_opmode;            /* sta operating mode */
 };
 
+#endif
index 410a084f35d33e9b30ed2a53a26197fcf69883e3..9840466f044bd1d22a95be4e923627a161f1efe1 100644 (file)
@@ -51,6 +51,7 @@
        {                                                                                                       \
                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                                                                                    \