From 49ad84851454062ca65577bccfeed2a0cb072095 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Thu, 28 Jul 2022 20:18:40 +0200 Subject: [PATCH] libobs-d3d11: Replace invocations of sprintf with snprintf Fixes deprecation warnings in Xcode 14/clang on macOS and reduces chance of buffer overflows. --- libobs-d3d11/d3d11-subsystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libobs-d3d11/d3d11-subsystem.cpp b/libobs-d3d11/d3d11-subsystem.cpp index ecbebfc0f..47b3fbb03 100644 --- a/libobs-d3d11/d3d11-subsystem.cpp +++ b/libobs-d3d11/d3d11-subsystem.cpp @@ -330,7 +330,8 @@ void gs_device::InitCompiler() int ver = 49; while (ver > 30) { - sprintf(d3dcompiler, "D3DCompiler_%02d.dll", ver); + snprintf(d3dcompiler, sizeof(d3dcompiler), + "D3DCompiler_%02d.dll", ver); HMODULE module = LoadLibraryA(d3dcompiler); if (module) {