Skip to content

Commit 3eabed2

Browse files
committed
cdl_header_parser.c compile warning -Wstringop-truncation
1 parent 459b248 commit 3eabed2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dispatchers/cdl_header_parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ int parse_attr(char **bptr,
411411
*bptr += strlen(line) + 1;
412412
while (**bptr == '\n') (*bptr)++;
413413

414-
strcpy(line_cpy, line);
414+
strncpy(line_cpy, line, LINE_SIZE-1);
415415

416416
prefix_len = strspn(line_cpy, " \t");
417417
key = line_cpy + prefix_len;
@@ -499,7 +499,7 @@ int parse_vars(char **bptr,
499499
*bptr += strlen(line) + 1;
500500
while (**bptr == '\n') (*bptr)++;
501501

502-
strncpy(orig_line, line, LINE_SIZE);
502+
strncpy(orig_line, line, LINE_SIZE-1);
503503

504504
prefix_len = strspn(line, " \t");
505505
line += prefix_len;

0 commit comments

Comments
 (0)