fix txpwr
authorMike Baker <mbm@openwrt.org>
Fri, 24 Mar 2006 14:39:27 +0000 (14:39 +0000)
committerMike Baker <mbm@openwrt.org>
Fri, 24 Mar 2006 14:39:27 +0000 (14:39 +0000)
SVN-Revision: 3474

openwrt/package/wificonf/wificonf.c

index dec61190aad9766d5bef0220ce92a2ab11fe8059..251ebb958573caf764bed6d4f1003316f0e2255a 100644 (file)
@@ -390,9 +390,12 @@ static void setup_bcom(int skfd, char *ifname)
        
        val = atoi(nvram_safe_get(wl_var("txpwr")));
        if (val <= 0)
-               val = atoi(nvram_safe_get(wl_var("pa0maxpwr")));
-       val = mw_to_qdbm(val);
-       bcom_set_int(skfd, ifname, "qtxpower", val);
+               val = atoi(nvram_safe_get("pa0maxpwr"));
+
+       if (val) {
+               val = mw_to_qdbm(val);
+               bcom_set_int(skfd, ifname, "qtxpower", val);
+       }
        
        /* Set other options */
        val = nvram_enabled(wl_var("lazywds"));