Skip to content

Commit 19315c1

Browse files
committed
sys_ident: Quiet strncpy warning
The string is terminated by explicit NUL assignement below, use memcpy instead of strncpy.
1 parent 13ea9e4 commit 19315c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sys_ident.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ print_sys_part_id(void)
364364
temp[2] = '\0';
365365
prefix = atoi(temp);
366366

367-
strncpy(cc, sys_id+6, 2);
367+
memcpy(cc, sys_id+6, 2);
368368
cc[2] = '\0';
369369

370370
strncpy(sssss, sys_id+8, 5);
@@ -386,7 +386,7 @@ print_sys_part_id(void)
386386

387387
close(fd);
388388

389-
strncpy(tttt, model+4, 4);
389+
memcpy(tttt, model+4, 4);
390390
tttt[4] = '\0';
391391

392392
fd = open("/proc/device-tree/ibm,partition-no", O_RDONLY);

0 commit comments

Comments
 (0)