PERFORCE change 153226 for review
Sam Leffler
sam at FreeBSD.org
Wed Nov 19 11:00:12 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=153226
Change 153226 by sam at sam_ebb on 2008/11/19 19:00:00
fix handling of unknown country codes; atoi doesn't return -1
for an invalid string as I thought; so use strtol instead
Affected files ...
.. //depot/projects/vap/sbin/ifconfig/ifieee80211.c#32 edit
Differences ...
==== //depot/projects/vap/sbin/ifconfig/ifieee80211.c#32 (text+ko) ====
@@ -1981,8 +1981,12 @@
cc = lib80211_country_findbyname(rdp, val);
if (cc == NULL) {
- cc = lib80211_country_findbycc(rdp, atoi(val));
- if (cc == NULL)
+ char *eptr;
+ long code = strtol(val, &eptr, 0);
+
+ if (eptr != val)
+ cc = lib80211_country_findbycc(rdp, code);
+ if (eptr == val || cc == NULL)
errx(1, "unknown ISO country code %s", val);
}
getregdomain(s);
More information about the p4-projects
mailing list