Changeset 6264

Show
Ignore:
Timestamp:
09/29/10 09:27:16 (3 years ago)
Author:
jow
Message:

[libiwinfo] fixup ccode in wl_get_country()

Location:
luci/trunk/contrib/package/iwinfo
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/contrib/package/iwinfo/Makefile

    r6260 r6264  
    88 
    99PKG_NAME:=libiwinfo 
    10 PKG_RELEASE:=2 
     10PKG_RELEASE:=3 
    1111 
    1212PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) 
  • luci/trunk/contrib/package/iwinfo/src/iwinfo_wl.c

    r6260 r6264  
    483483int wl_get_country(const char *ifname, char *buf) 
    484484{ 
    485     if( !wl_ioctl(ifname, WLC_GET_COUNTRY, buf, WLC_CNTRY_BUF_SZ) ) 
     485    char ccode[WLC_CNTRY_BUF_SZ]; 
     486 
     487    if( !wl_ioctl(ifname, WLC_GET_COUNTRY, ccode, WLC_CNTRY_BUF_SZ) ) 
     488    { 
     489        /* IL0 -> World */ 
     490        if( !strcmp(ccode, "IL0") ) 
     491            sprintf(buf, "00"); 
     492 
     493        /* YU -> RS */ 
     494        else if( !strcmp(ccode, "YU") ) 
     495            sprintf(buf, "RS"); 
     496 
     497        else 
     498            memcpy(buf, ccode, 2); 
     499 
    486500        return 0; 
     501    } 
    487502 
    488503    return -1;