Browse Source

Fixed non-POD varargs.

Бранимир Караџић 4 years ago
parent
commit
c7fc7b4ac6
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/string.cpp
  2. 2 2
      tests/vsnprintf_test.cpp

+ 1 - 1
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':

+ 2 - 2
tests/vsnprintf_test.cpp

@@ -233,8 +233,8 @@ TEST_CASE("vsnprintf")
 		) );
 
 	REQUIRE(test("hello, world!", "%S, %S!"
-		, hello
-		, world
+		, &hello
+		, &world
 		) );
 }