From 7e18a46ec213535bb5712b6df7048aa490653761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 18 Sep 2023 15:44:53 +0200 Subject: [PATCH] d3d11: don't skip last char in buffer Both buffers have the same size (32) and if the source is not null terminated it should be fixed there. Copy whole buffer. --- video/out/d3d11/ra_d3d11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index 8a48040e2c..e2a2b633b6 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -1598,7 +1598,7 @@ static void save_cached_program(struct ra *ra, struct ra_renderpass *pass, .comp_bytecode_len = comp_bc.len, }; memcpy(header.magic, cache_magic, sizeof(header.magic)); - strncpy(header.compiler, spirv->name, sizeof(header.compiler) - 1); + strncpy(header.compiler, spirv->name, sizeof(header.compiler)); struct bstr *prog = &pass->params.cached_program; bstr_xappend(pass, prog, (bstr){ (char *) &header, sizeof(header) });