mirror of
https://github.com/apache/nuttx.git
synced 2025-12-17 10:16:49 +08:00
nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
This commit is contained in:
@@ -342,9 +342,9 @@ static int spiffs_readdir_callback(FAR struct spiffs_s *fs,
|
||||
}
|
||||
#endif
|
||||
|
||||
strncpy(entryp->d_name,
|
||||
strlcpy(entryp->d_name,
|
||||
(FAR char *)objhdr.name + SPIFFS_LEADING_SLASH_SIZE,
|
||||
NAME_MAX);
|
||||
sizeof(entryp->d_name));
|
||||
entryp->d_type = objhdr.type;
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user