mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-23 00:50:00 +08:00
Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:

committed by
Petro Karashchenko

parent
7c37421266
commit
73701cd7cd
@@ -1059,8 +1059,7 @@ static int lesp_parse_cwjap_ans_line(char *ptr, lesp_ap_t *ap)
|
||||
case 1:
|
||||
ptr++; /* Remove first '"' */
|
||||
*(ptr_next - 1) = '\0';
|
||||
strncpy(ap->ssid, ptr, LESP_SSID_SIZE);
|
||||
ap->ssid[LESP_SSID_SIZE] = '\0';
|
||||
strlcpy(ap->ssid, ptr, LESP_SSID_SIZE + 1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@@ -1185,8 +1184,7 @@ static int lesp_parse_cwlap_ans_line(char *ptr, lesp_ap_t *ap)
|
||||
case 2:
|
||||
ptr++; /* Remove first '"' */
|
||||
*(ptr_next - 1) = '\0';
|
||||
strncpy(ap->ssid, ptr, LESP_SSID_SIZE);
|
||||
ap->ssid[LESP_SSID_SIZE] = '\0';
|
||||
strlcpy(ap->ssid, ptr, LESP_SSID_SIZE + 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
Reference in New Issue
Block a user