summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2023-03-20 17:09:42 -0700
committerJames Zern <jzern@google.com>2023-03-20 17:09:42 -0700
commit1c37aefcbd0aebc1f2043b3e9d2c9fd61e6275ef (patch)
tree3312fb7f553bb38b4a456ef6b2b753d8569ce01e /examples
parentc0f11c7f6ce73626cc20498efdad0ca3f897ed3b (diff)
downloadlibvpx-1c37aefcbd0aebc1f2043b3e9d2c9fd61e6275ef.tar
libvpx-1c37aefcbd0aebc1f2043b3e9d2c9fd61e6275ef.tar.gz
libvpx-1c37aefcbd0aebc1f2043b3e9d2c9fd61e6275ef.tar.bz2
libvpx-1c37aefcbd0aebc1f2043b3e9d2c9fd61e6275ef.zip
svc_encodeframe.c: fix -Wstringop-truncation
use sizeof(buf) - 1 with strncpy. fixes: examples/svc_encodeframe.c:282:3: warning: ‘strncpy’ specified bound 1024 equals destination size [-Wstringop-truncation] 282 | strncpy(si->options, options, sizeof(si->options)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I46980872f9865ae1dc2b56330c3a65d8bc6cf1f7
Diffstat (limited to 'examples')
-rw-r--r--examples/svc_encodeframe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/svc_encodeframe.c b/examples/svc_encodeframe.c
index 003096e70..c2b3ec979 100644
--- a/examples/svc_encodeframe.c
+++ b/examples/svc_encodeframe.c
@@ -279,7 +279,7 @@ vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options) {
if (svc_ctx == NULL || options == NULL || si == NULL) {
return VPX_CODEC_INVALID_PARAM;
}
- strncpy(si->options, options, sizeof(si->options));
+ strncpy(si->options, options, sizeof(si->options) - 1);
si->options[sizeof(si->options) - 1] = '\0';
return VPX_CODEC_OK;
}