Skip to content

Commit

Permalink
fix set hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
microdev1 committed Jul 9, 2023
1 parent 95535a8 commit 8704ba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/raspberrypi/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) {

void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *hostname) {
assert(strlen(hostname) < MP_ARRAY_SIZE(self->hostname));
memcpy(self->hostname, hostname, strlen(hostname));
strncpy(self->hostname, hostname, MP_ARRAY_SIZE(self->hostname) - 1);
netif_set_hostname(NETIF_STA, self->hostname);
netif_set_hostname(NETIF_AP, self->hostname);
}
Expand Down

0 comments on commit 8704ba1

Please sign in to comment.