summaryrefslogtreecommitdiff
path: root/src/print_wireless_info.c
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2016-08-14 06:29:20 -0700
committerGitHub <noreply@github.com>2016-08-14 06:29:20 -0700
commit6e4ca31aa5febcc546ec3b32a09793085ea114f0 (patch)
treec4c745f17954aa1f54dd8b6ec28e40e6d124b648 /src/print_wireless_info.c
parent712c5b0f0b64b62b7c0395acd6b295361f741735 (diff)
parenteb0b6412af16fe00ce38faa31bd50c238f4e7098 (diff)
Merge pull request #149 from tommie/incremental_multibatt
Fix some compilation warnings on OpenBSD and NetBSD
Diffstat (limited to 'src/print_wireless_info.c')
-rw-r--r--src/print_wireless_info.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
index 25e167f..14879eb 100644
--- a/src/print_wireless_info.c
+++ b/src/print_wireless_info.c
@@ -54,6 +54,13 @@
#include <netinet/if_ether.h>
#include <net80211/ieee80211.h>
#include <net80211/ieee80211_ioctl.h>
+#define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
+#endif
+
+#ifdef __NetBSD__
+#include <sys/types.h>
+#include <net80211/ieee80211.h>
+#define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
#endif
#include "i3status.h"
@@ -423,7 +430,7 @@ error1:
else
len = IEEE80211_NWID_LEN + 1;
- strncpy(&info->essid[0], nwid.i_nwid, len);
+ strncpy(&info->essid[0], (char *)nwid.i_nwid, len);
info->essid[IW_ESSID_MAX_SIZE] = '\0';
info->flags |= WIRELESS_INFO_FLAG_HAS_ESSID;
}