From a086d6451410c5c68e50f8d620eed52fd9be77af Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sat, 8 Jan 2022 22:28:12 +0100 Subject: Fix uppercasing of integer and float formatters reading too much or wrong data --- include/cxxformat/formatters.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cxxformat/formatters.hpp b/include/cxxformat/formatters.hpp index 55874f1..c32d2e8 100644 --- a/include/cxxformat/formatters.hpp +++ b/include/cxxformat/formatters.hpp @@ -117,7 +117,7 @@ namespace format { if (spec.conversion == 'X') { - std::transform(result.begin(), result.end(), result.data(), [](char c) + std::transform(converted.begin(), converted.end(), result.data(), [](char c) { return (c >= 'a' && c <= 'z') ? c + ('A' - 'a') : c; }); @@ -368,7 +368,7 @@ namespace format { if (uppercase) { - std::transform(result.data(), end, result.data(), [](char c) + std::transform(data, end, data, [](char c) { return (c >= 'a' && c <= 'z') ? c + ('A' - 'a') : c; }); -- cgit v1.2.3-54-g00ecf