diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-02 10:35:08 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-02 10:35:08 +0100 |
commit | a1ea3754a36e119ce3f2133b65ece1d19d805376 (patch) | |
tree | 84f55cb40381d15557fc138d6133dd24506a9221 | |
parent | 05252cfd3a74ed1b9cd947857d13c0c799a66e7c (diff) | |
download | serenity-a1ea3754a36e119ce3f2133b65ece1d19d805376.zip |
AK: Handle '%llu' in printf() (unsigned 64-bit integer)
I got a warning when using '%Q' since that's non-standard. This patch
makes our printf family accept '%llu'.
-rw-r--r-- | AK/PrintfImplementation.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/AK/PrintfImplementation.h b/AK/PrintfImplementation.h index 5c8e431d8d..907d03d77a 100644 --- a/AK/PrintfImplementation.h +++ b/AK/PrintfImplementation.h @@ -298,7 +298,10 @@ template<typename PutChFunc> break; case 'u': - ret += print_number(putch, bufptr, va_arg(ap, u32), left_pad, zeroPad, fieldWidth); + if (long_qualifiers >= 2) + ret += print_u64(putch, bufptr, va_arg(ap, u64), left_pad, zeroPad, fieldWidth); + else + ret += print_number(putch, bufptr, va_arg(ap, u32), left_pad, zeroPad, fieldWidth); break; case 'Q': |