Skip to content

Commit 115f3e0

Browse files
committed
Updated code as per helpful suggestion
1 parent 66d8778 commit 115f3e0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ports/esp32s2/common-hal/wifi/Network.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,34 +56,34 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) {
5656
}
5757

5858
mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) {
59-
char authmode[16];
59+
const char* authmode = "";
6060
switch (self->record.authmode) {
6161
case WIFI_AUTH_OPEN:
62-
strcpy(authmode, "OPEN");
62+
authmode = "OPEN";
6363
break;
6464
case WIFI_AUTH_WEP:
65-
strcpy(authmode, "WEP");
65+
authmode = "WEP";
6666
break;
6767
case WIFI_AUTH_WPA_PSK:
68-
strcpy(authmode, "WPA_PSK");
68+
authmode = "WPA_PSK";
6969
break;
7070
case WIFI_AUTH_WPA2_PSK:
71-
strcpy(authmode, "WPA2_PSK");
71+
authmode = "WPA2_PSK";
7272
break;
7373
case WIFI_AUTH_WPA_WPA2_PSK:
74-
strcpy(authmode, "WPA_WPA2_PSK");
74+
authmode = "WPA_WPA2_PSK";
7575
break;
7676
case WIFI_AUTH_WPA2_ENTERPRISE:
77-
strcpy(authmode, "WPA2_ENTERPRISE");
77+
authmode = "WPA2_ENTERPRISE";
7878
break;
7979
case WIFI_AUTH_WPA3_PSK:
80-
strcpy(authmode, "WPA3_PSK");
80+
authmode = "WPA3_PSK";
8181
break;
8282
case WIFI_AUTH_WPA2_WPA3_PSK:
83-
strcpy(authmode, "WPA2_WPA3_PSK");
83+
authmode = "WPA2_WPA3_PSK";
8484
break;
8585
default:
86-
strcpy(authmode, "UNKNOWN");
86+
authmode = "UNKNOWN";
8787
break;
8888
}
8989
const char* cstr = (const char*) authmode;

0 commit comments

Comments
 (0)