Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7972
-gerrit
commit 25c07c4edf21deb5e0ae126b44284ed08c9e217d Author: Patrick Georgi patrick@georgi-clan.de Date: Mon Dec 29 19:53:51 2014 +0100
libpayload: fix printf handling of unsigned long long
1 << 63 is undefined for 32bit numbers.
Change-Id: I22f0e2486b133ea18cfbb8dd79fd4aed91ac0a4c Signed-off-by: Patrick Georgi patrick@georgi-clan.de Found-by: Coverity Scan --- payloads/libpayload/libc/printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/libc/printf.c b/payloads/libpayload/libc/printf.c index 8f76ccf..cb623aa 100644 --- a/payloads/libpayload/libc/printf.c +++ b/payloads/libpayload/libc/printf.c @@ -647,7 +647,7 @@ static int printf_core(const char *fmt, struct printf_spec *ps, va_list ap) }
if (flags & __PRINTF_FLAG_SIGNED) { - if (number & (0x1 << (size * 8 - 1))) { + if (number & (0x1ULL << (size * 8 - 1))) { flags |= __PRINTF_FLAG_NEGATIVE;
if (size == sizeof(uint64_t)) {