Replace all strncpy with strlcpy

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2023-03-06 01:26:18 +08:00
committed by Petro Karashchenko
parent 7c37421266
commit 73701cd7cd
35 changed files with 78 additions and 121 deletions

View File

@@ -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: