From bf00a8215141e25adb74d576f190493552b4b53d Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Mon, 20 Jul 2020 20:31:01 +0200 Subject: [PATCH] fixed problem with format() in tinytiffreader_test.cpp --- tests/tinytiffreader_test/tinytiffreader_test.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/tinytiffreader_test/tinytiffreader_test.cpp b/tests/tinytiffreader_test/tinytiffreader_test.cpp index 75fc077..d5e4831 100644 --- a/tests/tinytiffreader_test/tinytiffreader_test.cpp +++ b/tests/tinytiffreader_test/tinytiffreader_test.cpp @@ -65,12 +65,10 @@ return d; }; - std::string format(const std::string& templ, ...){ - va_list ap; +template + std::string format(const std::string& templ, const T& val){ char buffer[4096]; - va_start (ap, templ); - vsprintf (buffer, templ.c_str(), ap); - va_end (ap); + sprintf(buffer, templ.c_str(), val); std::string ret(buffer); return ret; };