From f3098cd61b663d3368baf23299e7d1a530e6cec5 Mon Sep 17 00:00:00 2001 From: BtbN Date: Sat, 20 Oct 2018 10:50:08 +0200 Subject: 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] --- video/out/gpu/spirv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3