From e48043b095fab14af7c81868de618daa61f515ae Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 20 Sep 2021 17:17:07 -0700 Subject: [PATCH] elogtool: compile in 32-bit platforms This CL fixes a compilation error that happens in 32-bit platforms. This error happens because printf() was using %ld instead of %zu to print size_t variables. This CL fixes it. BUG=b:200608182 TEST=emerge-kevin (ARM 32-bit) TEST=emerge-eve (Intel 64-bit) Change-Id: I340e108361c052601f2b126db45caf2e35ee7ace Signed-off-by: Ricardo Quesada Reviewed-on: https://review.coreboot.org/c/coreboot/+/57792 Tested-by: build bot (Jenkins) Reviewed-by: Paul Fagerburg --- util/cbfstool/elogtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cbfstool/elogtool.c b/util/cbfstool/elogtool.c index 4cce5a699a..253e2ee95a 100644 --- a/util/cbfstool/elogtool.c +++ b/util/cbfstool/elogtool.c @@ -250,7 +250,7 @@ static void cmd_add_usage(void) ": an hexadecimal number (0-255). Prefix '0x' is optional\n" "[event_data]: (optional) a series of hexadecimal numbers. Must be:\n" " - len(event_data) %% 2 == 0\n" - " - len(event_data) in bytes <= %ld\n" + " - len(event_data) in bytes <= %zu\n" "\n" "Example:\n" "%s add 0x16 01ABF0 # 01ABF0 is actually three bytes: 0x01, 0xAB and 0xF0\n" @@ -300,7 +300,7 @@ static int cmd_add_parse_args(uint8_t *type, uint8_t *data, size_t *data_size) if (*data_size > ELOG_MAX_EVENT_DATA_SIZE) { fprintf(stderr, - "Error: Event data length (in bytes) should be <= %ld; got: %ld\n", + "Error: Event data length (in bytes) should be <= %zu; got: %zu\n", ELOG_MAX_EVENT_DATA_SIZE, *data_size); return ELOGTOOL_EXIT_BAD_ARGS; }