From e098a3269a04bc05abeced2a1db68f8fd335add2 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 13 May 2023 12:40:03 +0200 Subject: [PATCH] libluna: Treat a negative precision as if precision was omitted --- libluna/src/Format.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libluna/src/Format.cpp b/libluna/src/Format.cpp index c2aafc46..70ecc794 100644 --- a/libluna/src/Format.cpp +++ b/libluna/src/Format.cpp @@ -139,7 +139,10 @@ static usize parse_precision(const char** format, flags_t& flags, va_list ap) const int precision = va_arg(ap, int); if (precision >= 0) result = (usize)precision; else + { result = 0; + flags &= ~FLAG_USE_PRECISION; + } (*format)++; } }