From 1d9a4ddbf54c9673b3c0001dac838207b63eb95a Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 21 Dec 2019 18:07:08 +0100 Subject: [PATCH] gs-helper: Fix nonstandard usage of va_start --- source/obs/gs/gs-helper.cpp | 6 +++--- source/obs/gs/gs-helper.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/obs/gs/gs-helper.cpp b/source/obs/gs/gs-helper.cpp index 1d49c8ab..99854d85 100644 --- a/source/obs/gs/gs-helper.cpp +++ b/source/obs/gs/gs-helper.cpp @@ -34,14 +34,14 @@ gs::context::~context() gs_debug_marker_begin(color, _name.c_str()); }*/ -gs::debug_marker::debug_marker(const float color[4], std::string format, ...) +gs::debug_marker::debug_marker(const float color[4], const char* format, ...) { size_t size; - std::vector buffer(64); + std::vector buffer(128); va_list vargs; va_start(vargs, format); - size = vsnprintf(buffer.data(), buffer.size(), format.c_str(), vargs); + size = static_cast(vsnprintf(buffer.data(), buffer.size(), format, vargs)); va_end(vargs); _name = std::string(buffer.data(), buffer.data() + size); diff --git a/source/obs/gs/gs-helper.hpp b/source/obs/gs/gs-helper.hpp index e8899767..b6ec46c9 100644 --- a/source/obs/gs/gs-helper.hpp +++ b/source/obs/gs/gs-helper.hpp @@ -50,7 +50,7 @@ namespace gs { public: //debug_marker(const float color[4], std::string name); - debug_marker(const float color[4], std::string format, ...); + debug_marker(const float color[4], const char* format, ...); ~debug_marker(); }; } // namespace gs