mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: When printf assert on unsupported specifier, specify which one!
We were asserting without saying why. That's a bit unhelpful. :^)
This commit is contained in:
parent
56e0e6be56
commit
d10ca2b010
Notes:
sideshowbarker
2024-07-19 12:15:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d10ca2b0103
1 changed files with 6 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue