summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libadhocutil/compileTimeFormatter.h2
-rw-r--r--libadhocutil/unittests/testCompileTimeFormatter.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h
index 35dffde..5f0237e 100644
--- a/libadhocutil/compileTimeFormatter.h
+++ b/libadhocutil/compileTimeFormatter.h
@@ -193,7 +193,7 @@ namespace AdHoc {
#define scprintf(strmp, fmt, ...) \
([](decltype(strmp) & strm) -> auto & { \
static constexpr auto __FMT = fmt; \
- return ::AdHoc::Formatter<__FMT>::write(strm, __VA_ARGS__); \
+ return ::AdHoc::Formatter<__FMT>::write(strm, ##__VA_ARGS__); \
}(strmp))
#endif
diff --git a/libadhocutil/unittests/testCompileTimeFormatter.cpp b/libadhocutil/unittests/testCompileTimeFormatter.cpp
index 9bb81f6..37d1947 100644
--- a/libadhocutil/unittests/testCompileTimeFormatter.cpp
+++ b/libadhocutil/unittests/testCompileTimeFormatter.cpp
@@ -454,6 +454,7 @@ BOOST_AUTO_TEST_CASE(scprintf)
auto & strret = scprintf(*str, "Some literal format string (%d, %c).", 0, 'f');
BOOST_CHECK_EQUAL(str.get(), &strret); // We got back our original stream
BOOST_CHECK_EQUAL(str->str(), "Some literal format string (0, f).");
+ scprintf(*str, "Some literal format string, no args.");
}
#endif