summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-04 20:44:04 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-04 20:48:30 +0100
commit4623811ec3f3f63db52a69640a5eb2d91ce2ebb3 (patch)
tree63950c2b5af6170c8a886566b875348ee80fa15f
parent715d7a8532caa0d6b818020f4c2f47e85791d2bf (diff)
downloadserenity-4623811ec3f3f63db52a69640a5eb2d91ce2ebb3.zip
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.
-rw-r--r--AK/PrintfImplementation.h6
1 files 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<typename PutChFunc>
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<typename PutChFunc>
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);