iwinfo: fix string format for country code
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 2 Jul 2014 21:43:17 +0000 (21:43 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 2 Jul 2014 21:43:17 +0000 (21:43 +0000)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 41485

package/network/utils/iwinfo/src/iwinfo_wl.c

index 0b3b4bd8a212989d13e42fc37edf1624d61c1311..b626b285bbd2ccb01d5bea61ffd947b611111f76 100644 (file)
@@ -565,7 +565,7 @@ static int wl_get_countrylist(const char *ifname, char *buf, int *len)
        {
                for (i = 0, count = 0; i < cl->count; i++, c++)
                {
        {
                for (i = 0, count = 0; i < cl->count; i++, c++)
                {
-                       sprintf(c->ccode, &cl->country_abbrev[i * WLC_CNTRY_BUF_SZ]);
+                       snprintf(c->ccode, sizeof(c->ccode), "%s", &cl->country_abbrev[i * WLC_CNTRY_BUF_SZ]);
                        c->iso3166 = c->ccode[0] * 256 + c->ccode[1];
 
                        /* IL0 -> World */
                        c->iso3166 = c->ccode[0] * 256 + c->ccode[1];
 
                        /* IL0 -> World */