diff options
| author | BennyE <bennye_hh@posteo.net> | 2021-01-07 23:05:16 +0100 |
|---|---|---|
| committer | BennyE <bennye_hh@posteo.net> | 2021-01-07 23:05:16 +0100 |
| commit | 115f3e08677520806b95dfc92e4462d119854023 (patch) | |
| tree | 7b81673e8e5ea85669585edb2c5f8a223310ee77 | |
| parent | 66d87782be3793fd179b12fa864e71509f1dbf6f (diff) | |
Updated code as per helpful suggestion
| -rw-r--r-- | ports/esp32s2/common-hal/wifi/Network.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c index 0289ad4eb..83c675a19 100644 --- a/ports/esp32s2/common-hal/wifi/Network.c +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -56,34 +56,34 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) { } mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { - char authmode[16]; + const char* authmode = ""; switch (self->record.authmode) { case WIFI_AUTH_OPEN: - strcpy(authmode, "OPEN"); + authmode = "OPEN"; break; case WIFI_AUTH_WEP: - strcpy(authmode, "WEP"); + authmode = "WEP"; break; case WIFI_AUTH_WPA_PSK: - strcpy(authmode, "WPA_PSK"); + authmode = "WPA_PSK"; break; case WIFI_AUTH_WPA2_PSK: - strcpy(authmode, "WPA2_PSK"); + authmode = "WPA2_PSK"; break; case WIFI_AUTH_WPA_WPA2_PSK: - strcpy(authmode, "WPA_WPA2_PSK"); + authmode = "WPA_WPA2_PSK"; break; case WIFI_AUTH_WPA2_ENTERPRISE: - strcpy(authmode, "WPA2_ENTERPRISE"); + authmode = "WPA2_ENTERPRISE"; break; case WIFI_AUTH_WPA3_PSK: - strcpy(authmode, "WPA3_PSK"); + authmode = "WPA3_PSK"; break; case WIFI_AUTH_WPA2_WPA3_PSK: - strcpy(authmode, "WPA2_WPA3_PSK"); + authmode = "WPA2_WPA3_PSK"; break; default: - strcpy(authmode, "UNKNOWN"); + authmode = "UNKNOWN"; break; } const char* cstr = (const char*) authmode; |
