From 21a282a2a427cb33d12d1d31ae8aee14d9bbb8c3 Mon Sep 17 00:00:00 2001 From: Marco Paland Date: Fri, 14 Sep 2018 15:02:57 +0200 Subject: fix(printf): ignore 0 flag for integers if precision is specified Fixes #27 --- test/test_suite.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/test_suite.cpp') diff --git a/test/test_suite.cpp b/test/test_suite.cpp index 99e07b7..45f1abe 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -934,6 +934,12 @@ TEST_CASE("length", "[]" ) { test::sprintf(buffer, "%20.X", 0U); REQUIRE(!strcmp(buffer, " ")); + + test::sprintf(buffer, "%02.0u", 0U); + REQUIRE(!strcmp(buffer, " ")); + + test::sprintf(buffer, "%02.0d", 0); + REQUIRE(!strcmp(buffer, " ")); } -- cgit v1.2.3