From 4623811ec3f3f63db52a69640a5eb2d91ce2ebb3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 4 Nov 2019 20:44:04 +0100 Subject: [PATCH] AK: Let's just log unimplemented printf() format strings It's too dang frustrating that we actually crash whenever we hit some unimplemented printf specifier. Let's just log the whole format string and carry on as best we can. --- AK/PrintfImplementation.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AK/PrintfImplementation.h b/AK/PrintfImplementation.h index 907d03d77a..59d4f5e319 100644 --- a/AK/PrintfImplementation.h +++ b/AK/PrintfImplementation.h @@ -250,6 +250,9 @@ template if (*p == '%' && *(p + 1)) { one_more: ++p; + // FIXME: This is just a hack workaround to prevent choking on '.' specifiers + if (*p == '.') + goto one_more; if (*p == '-') { left_pad = true; if (*(p + 1)) @@ -356,8 +359,7 @@ template ret += print_hex(putch, bufptr, va_arg(ap, u32), *p == 'P', true, false, true, 8); break; default: - dbg() << "printf_internal: Unimplemented format specifier " << *p; - ASSERT_NOT_REACHED(); + dbg() << "printf_internal: Unimplemented format specifier " << *p << " (fmt: " << fmt << ")"; } } else { putch(bufptr, *p);