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 344c120..ad3b5dd 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
 
 #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;
 
        uint32_t                                needed; /* bytes needed (optional) */
 } wl_ioctl_t;
 
-#endif /* _wlioctl_h_ */
+#endif
index c1eeca7..fd19dbf 100644 (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 */
 #define        IEEE80211_ADDR_LEN              6
 
 /* ieee80211.h */
 #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
index 410a084..9840466 100644 (file)
@@ -51,6 +51,7 @@
        {                                                                                                       \
                const char *ifname = luaL_checkstring(L, 1);    \
                char rv[IWINFO_BUFSIZE];                                                \
        {                                                                                                       \
                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                                                                                    \
                if( !type##_get_##op(ifname, rv) )                              \
                        lua_pushstring(L, rv);                                          \
                else                                                                                    \