diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-06 20:27:58 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-06 20:27:58 +0200 |
commit | d10ca2b0103f5667706945e4c828e06d33e15f9a (patch) | |
tree | 09ee3ca1ae480dc97e97c05ba7ca10edce7bc3f9 /AK/PrintfImplementation.h | |
parent | 56e0e6be56f4109139bcc2e4b4accd5fd76567cb (diff) | |
download | serenity-d10ca2b0103f5667706945e4c828e06d33e15f9a.zip |
AK: When printf assert on unsupported specifier, specify which one!
We were asserting without saying why. That's a bit unhelpful. :^)
Diffstat (limited to 'AK/PrintfImplementation.h')
-rw-r--r-- | AK/PrintfImplementation.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/AK/PrintfImplementation.h b/AK/PrintfImplementation.h index 9e8398163a..325541d384 100644 --- a/AK/PrintfImplementation.h +++ b/AK/PrintfImplementation.h @@ -1,6 +1,7 @@ #pragma once #include <AK/Assertions.h> +#include <AK/LogStream.h> #include <AK/Types.h> #include <stdarg.h> @@ -10,7 +11,7 @@ static constexpr const char* printf_hex_digits_upper = "0123456789ABCDEF"; #ifdef __serenity__ extern "C" size_t strlen(const char*); #else -#include <string.h> +# include <string.h> #endif template<typename PutChFunc, typename T> @@ -266,9 +267,9 @@ template<typename PutChFunc> goto one_more; } if (*p == '*') { - fieldWidth = va_arg(ap, int); - if (*(p + 1)) - goto one_more; + fieldWidth = va_arg(ap, int); + if (*(p + 1)) + goto one_more; } if (*p == 'l') { ++long_qualifiers; @@ -352,6 +353,7 @@ template<typename PutChFunc> ret += print_hex(putch, bufptr, va_arg(ap, u32), *p == 'P', true, true, true, 8); break; default: + dbg() << "printf_internal: Unimplemented format specifier " << *p; ASSERT_NOT_REACHED(); } } else { |