Fix libelf/libelf_coredump.c:234:7: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 31
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
10f8f6c9e3
commit
cd516bd09d
|
@ -227,11 +227,11 @@ static void elf_emit_note_info(FAR struct elf_dumpinfo_s *cinfo)
|
|||
|
||||
elf_emit(cinfo, &nhdr, sizeof(nhdr));
|
||||
|
||||
strncpy(name, tcb->name, sizeof(name));
|
||||
strlcpy(name, tcb->name, sizeof(name));
|
||||
elf_emit(cinfo, name, sizeof(name));
|
||||
|
||||
info.pr_pid = tcb->pid;
|
||||
strncpy(info.pr_fname, tcb->name, sizeof(info.pr_fname));
|
||||
strlcpy(info.pr_fname, tcb->name, sizeof(info.pr_fname));
|
||||
elf_emit(cinfo, &info, sizeof(info));
|
||||
|
||||
/* Fill Process status */
|
||||
|
|
Loading…
Reference in New Issue