mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Replace all strncpy with strlcpy for safety
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user