Skip to content

Commit 31ff368

Browse files
authored
Merge pull request ARMmbed#13493 from balajicyp/topic/cypress_target_ssid_fix
Fix SSID bug on Cypress Targets
2 parents 297300e + 3387c86 commit 31ff368

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/interface/WhdSTAInterface.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,12 @@ nsapi_error_t WhdSTAInterface::connect()
299299

300300
// setup ssid
301301
whd_ssid_t ssid;
302-
strncpy((char *)ssid.value, _ssid, SSID_NAME_SIZE);
303-
ssid.value[SSID_NAME_SIZE - 1] = '\0';
304-
ssid.length = strlen((char *)ssid.value);
302+
uint8_t ssid_len;
303+
304+
memset(&ssid, 0, sizeof(whd_ssid_t));
305+
ssid_len = strlen(_ssid);
306+
strncpy((char *)ssid.value, _ssid, ssid_len);
307+
ssid.length = ssid_len;
305308

306309
// choose network security
307310
whd_security_t security = whd_fromsecurity(_security);

0 commit comments

Comments
 (0)