aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar BtbN <btbn@btbn.de>2018-10-20 10:50:08 +0200
committerGravatar sfan5 <sfan5@live.de>2018-10-21 23:33:10 +0200
commitf3098cd61b663d3368baf23299e7d1a530e6cec5 (patch)
treec88e53b05716e4c73e74ed6444bd5ddb35d2d48d /video
parent24e21a02365adff7c032cd7cb47e9c8b8f06bd93 (diff)
vo_gpu: vulkan: fix strncpy truncation in spirv_compiler_init
Fixes GCC8 warning ../video/out/gpu/spirv.c: In function 'spirv_compiler_init': ../video/out/gpu/spirv.c:68:9: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/spirv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/gpu/spirv.c b/video/out/gpu/spirv.c
index e20fbe7483..06d33686d0 100644
--- a/video/out/gpu/spirv.c
+++ b/video/out/gpu/spirv.c
@@ -65,7 +65,7 @@ bool spirv_compiler_init(struct ra_ctx *ctx)
ctx->spirv->fns = compilers[i];
const char *name = m_opt_choice_str(compiler_choices, i);
- strncpy(ctx->spirv->name, name, sizeof(ctx->spirv->name));
+ strncpy(ctx->spirv->name, name, sizeof(ctx->spirv->name) - 1);
MP_VERBOSE(ctx, "Initializing SPIR-V compiler '%s'\n", name);
if (ctx->spirv->fns->init(ctx))
return true;