From: Roman Stratiienko Date: Fri, 20 Sep 2019 13:59:18 +0000 (+0200) Subject: cmd: part: number: return hexadecimal value X-Git-Tag: v2019.10~4^2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=400b9554cc3ef6d301940d43a2a6f9c098df5fb9;p=oweals%2Fu-boot.git cmd: part: number: return hexadecimal value At this point we are using part number sub-command to retrieve UUID of the partition using it's name. e.g.: part number mmc $mmcdev system_a system_a_index part uuid mmc $mmcdev:${system_a_index} system_a_uuid Since 'part uuid' sub-command expects partition index in hex format and 'part number' returns decimal value, 'part uuid' command will provide wrong UUID or fail. Fixes: be683756f62034 ("cmd: part: Add 'number' sub-command") Cc: Dirk Behme Reported-by: Pontus Fuchs Signed-off-by: Roman Stratiienko Signed-off-by: Eugeniu Rosca Reviewed-by: Tom Rini Reviewed-by: Igor Opaniuk --- diff --git a/cmd/part.c b/cmd/part.c index 6cfb67b279..5e4e45ca6d 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -152,7 +152,7 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param) snprintf(buf, sizeof(buf), LBAF, info.size); break; case CMD_PART_INFO_NUMBER: - snprintf(buf, sizeof(buf), "%d", part); + snprintf(buf, sizeof(buf), "0x%x", part); break; default: printf("** Unknown cmd_part_info value: %d\n", param);