From c7fc7b4ac6b2d13ab22f34f83838e91e132932e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 4 Oct 2021 13:28:19 -0700 Subject: [PATCH] Fixed non-POD varargs. --- src/string.cpp | 2 +- tests/vsnprintf_test.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/string.cpp b/src/string.cpp index d477bbe..9cfd948 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -1100,7 +1100,7 @@ namespace bx break; case 'S': - size += write(_writer, va_arg(_argList, const StringView), param, _err); + size += write(_writer, *va_arg(_argList, const StringView*), param, _err); break; case 'o': diff --git a/tests/vsnprintf_test.cpp b/tests/vsnprintf_test.cpp index 2cf1416..c218069 100644 --- a/tests/vsnprintf_test.cpp +++ b/tests/vsnprintf_test.cpp @@ -233,8 +233,8 @@ TEST_CASE("vsnprintf") ) ); REQUIRE(test("hello, world!", "%S, %S!" - , hello - , world + , &hello + , &world ) ); }