Skip to content

Commit

Permalink
remoteproc.c: fix compile error
Browse files Browse the repository at this point in the history
CC:  open-amp/lib/rpmsg/rpmsg_virtio.c open-amp/lib/remoteproc/remoteproc.c: In function 'remoteproc_init_mem':
open-amp/lib/remoteproc/remoteproc.c:309:17: error: 'strncpy' specified bound 32 equals destination size [-Werror=stringop-truncation]
  309 |                 strncpy(mem->name, name, sizeof(mem->name));

Signed-off-by: Yongrong Wang <[email protected]>
  • Loading branch information
wyr-7 committed Sep 19, 2024
1 parent c468328 commit 21f63ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/remoteproc/remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void remoteproc_init_mem(struct remoteproc_mem *mem, const char *name,
if (!mem || !io || size == 0)
return;
if (name)
strncpy(mem->name, name, sizeof(mem->name));
strncpy(mem->name, name, sizeof(mem->name) - 1);
else
mem->name[0] = 0;
mem->pa = pa;
Expand Down

0 comments on commit 21f63ca

Please sign in to comment.