summaryrefslogtreecommitdiff
path: root/fftools/cmdutils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-02-24 11:19:27 +0100
committerAnton Khirnov <anton@khirnov.net>2021-03-16 10:41:01 +0100
commitb334fd39c9c00c739faeece87fa81c980c148a16 (patch)
tree1b7501f60eecc5c3ede08a8c2501e31dbb0204bb /fftools/cmdutils.c
parent7d09579190def3ef7562399489e628f3b65714ce (diff)
downloadffmpeg-b334fd39c9c00c739faeece87fa81c980c148a16.tar.gz
cmdutils: replace strncpy() with direct assignment
Only one character is actually rewritten. Fixes truncation warnings, such as warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] in gcc 10.2.0
Diffstat (limited to 'fftools/cmdutils.c')
-rw-r--r--fftools/cmdutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 5e2d3c174b..fe424b6a4c 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1163,13 +1163,13 @@ static void print_buildconf(int flags, int level)
// Change all the ' --' strings to '~--' so that
// they can be identified as tokens.
while ((conflist = strstr(str, " --")) != NULL) {
- strncpy(conflist, "~--", 3);
+ conflist[0] = '~';
}
// Compensate for the weirdness this would cause
// when passing 'pkg-config --static'.
while ((remove_tilde = strstr(str, "pkg-config~")) != NULL) {
- strncpy(remove_tilde, "pkg-config ", 11);
+ remove_tilde[sizeof("pkg-config~") - 2] = ' ';
}
splitconf = strtok(str, "~");