File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
ports/raspberrypi/common-hal/wifi Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,10 @@ mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) {
92
92
}
93
93
94
94
void common_hal_wifi_radio_set_hostname (wifi_radio_obj_t * self , const char * hostname ) {
95
- self -> hostname = mp_obj_new_str ( hostname , strlen ( hostname ));
96
- hostname = mp_obj_str_get_str (self -> hostname );
97
- netif_set_hostname (NETIF_STA , hostname );
98
- netif_set_hostname (NETIF_AP , hostname );
95
+ assert ( strlen ( hostname ) < MP_ARRAY_SIZE ( self -> hostname ));
96
+ memcpy (self -> hostname , hostname , strlen ( hostname ) );
97
+ netif_set_hostname (NETIF_STA , self -> hostname );
98
+ netif_set_hostname (NETIF_AP , self -> hostname );
99
99
}
100
100
101
101
mp_obj_t common_hal_wifi_radio_get_mac_address (wifi_radio_obj_t * self ) {
Original file line number Diff line number Diff line change 33
33
34
34
typedef struct {
35
35
mp_obj_base_t base ;
36
- mp_obj_t hostname ;
36
+ char hostname [ 254 ]; // hostname max is 253 chars, + 1 for trailing NUL
37
37
wifi_scannednetworks_obj_t * current_scan ;
38
38
} wifi_radio_obj_t ;
39
39
You can’t perform that action at this time.
0 commit comments