This is more correct
authorRoy Marples <roy@marples.name>
Thu, 2 Oct 2014 09:05:02 +0000 (09:05 +0000)
committerRoy Marples <roy@marples.name>
Thu, 2 Oct 2014 09:05:02 +0000 (09:05 +0000)
src/libdhcpcd/wpa.c

index a452051b8a4d5015bcacca8b7f8a779c0132a4d6..c8af94232cf8998315168668dc90316d7ba96567 100644 (file)
@@ -578,7 +578,7 @@ dhcpcd_wpa_network_new(DHCPCD_WPA *wpa)
        return (int)l;
 }
 
        return (int)l;
 }
 
-static const char hexstr[] = "0123456789abcdef";
+static const char hexchrs[] = "0123456789abcdef";
 int
 dhcpcd_wpa_network_find_new(DHCPCD_WPA *wpa, const char *ssid)
 {
 int
 dhcpcd_wpa_network_find_new(DHCPCD_WPA *wpa, const char *ssid)
 {
@@ -607,8 +607,8 @@ dhcpcd_wpa_network_find_new(DHCPCD_WPA *wpa, const char *ssid)
                dp = dssid;
                for (; dl; dl--) {
                        c = (unsigned char)*dp++;
                dp = dssid;
                for (; dl; dl--) {
                        c = (unsigned char)*dp++;
-                       *ep++ = hexstr[c >> 4];
-                       *ep++ = hexstr[c & 0xf];
+                       *ep++ = hexchrs[(c & 0xf0) >> 4];
+                       *ep++ = hexchrs[(c & 0x0f)];
                }
        } else {
                *ep++ = '\"';
                }
        } else {
                *ep++ = '\"';