libc/lib_glob:use strlcpy instead of memcpy
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
5ec4df2cc6
commit
c30705f5f0
@ -328,7 +328,7 @@ static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat,
|
||||
continue;
|
||||
}
|
||||
|
||||
memcpy(buf + pos, de->d_name, l + 1);
|
||||
strlcpy(buf + pos, de->d_name, l + 1);
|
||||
|
||||
if (p2)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user