Replace all strncpy with strlcpy for safety

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi
2022-08-24 02:23:20 +00:00
committed by Xiang Xiao
parent 96f77cb6a6
commit e4e3208180
45 changed files with 89 additions and 107 deletions
+1 -1
View File
@@ -54,6 +54,6 @@ int strerror_r(int errnum, FAR char *buf, size_t buflen)
FAR const char *errstr = strerror(errnum);
DEBUGASSERT(buf != NULL);
strncpy(buf, errstr, buflen);
strlcpy(buf, errstr, buflen);
return OK;
}