1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

Stepan Zastupov's "fucking patch" (that's how he identifies it

himself) for WiFi stuff. Basicly, we use strlcpy() instead of
strncpy(). strlcpy() is avaible since FreeBSD 3.3 and on
Debian/kFreeBSD and simular systems it's possible to install
a third party lib to get a support for it (if somebody cares).


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@712 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Roman Bogorodskiy 2006-10-19 18:52:14 +00:00
parent 00e92953b6
commit a5de2b09d9

View File

@ -563,8 +563,7 @@ update_wifi_stats()
/* Get media type */
bzero(&ifmr, sizeof(ifmr));
strncpy(ifmr.ifm_name, ifa->ifa_name, strlen(ifmr.ifm_name) - 1);
ifmr.ifm_name[sizeof(ifmr.ifm_name) - 1] = '\0';
strlcpy(ifmr.ifm_name, ifa->ifa_name, IFNAMSIZ);
if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) {
perror("ioctl (getting media type)");
exit(1);
@ -577,8 +576,7 @@ update_wifi_stats()
!(ifmr.ifm_active & IFM_IEEE80211_HOSTAP)) {
/* Get wi status */
bzero(&ifr, sizeof(ifr));
strncpy(ifr.ifr_name, ifa->ifa_name, strlen(ifr.ifr_name) - 1);
ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ);
wireq.wi_type = WI_RID_COMMS_QUALITY;
wireq.wi_len = WI_MAX_DATALEN;
ifr.ifr_data = (void *) &wireq;