Fix text replacement warning

Using strncpy to cut off copying a terminating NUL yields a gcc
warning.  Just use memcpy instead.
This commit is contained in:
Dean Luick
2021-01-17 14:12:58 -06:00
parent 5dc5ece412
commit f63d435c6d
4 changed files with 5 additions and 5 deletions

View File

@@ -692,7 +692,7 @@ char *supplemental_name;
(note: strncpy() only terminates output string if the specified
count is bigger than the length of the substring being copied) */
if (!strncmp(dbase_str, "moist towel", 11))
(void) strncpy(dbase_str += 2, "wet", 3); /* skip "mo" replace "ist" */
memcpy(dbase_str += 2, "wet", 3); /* skip "mo" replace "ist" */
/* Make sure the name is non-empty. */
if (*dbase_str) {