summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2013-03-25 15:13:20 -0700
committerRonald G. Minnich <rminnich@gmail.com>2013-03-26 19:35:28 +0100
commite21f5e14834af6426bd6fc3e7f37f6b18243f416 (patch)
treebf41470b082894fa6e720742ee8e45d6f38fc434 /payloads/libpayload/libc
parenta6c495edcaaade187280262db1bbce887fa28003 (diff)
libpayload: fix size_t handling
libcbfs was using printf for size_t typed variables. However, printf did not support printing those. This patch fixes the issue, removing the warning when compiling ram_media.c libcbfs/ram_media.c:52:10: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat] libcbfs/ram_media.c:52:10: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat] Change-Id: Iaf6e723f9a5b0a61a39d3125036fee9853e37ba8 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2904 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/printf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/printf.c b/payloads/libpayload/libc/printf.c
index ccb64fd678..bc2c41c255 100644
--- a/payloads/libpayload/libc/printf.c
+++ b/payloads/libpayload/libc/printf.c
@@ -552,6 +552,9 @@ static int printf_core(const char *fmt, struct printf_spec *ps, va_list ap)
qualifier = PrintfQualifierByte;
}
break;
+ case 'z': /* size_t or ssize_t */
+ qualifier = PrintfQualifierLong;
+ break;
case 'l': /* long or long long */
qualifier = PrintfQualifierLong;
if (fmt[i] == 'l') {