From fb5f7949558a06cc43cf3e6aced32cc4686158d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 21 Apr 2017 19:39:10 +0200 Subject: [PATCH] fiptool: Support non-decimal --align arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An alignment value of 0x4000 is much easier to type than 16384, so enhance get_image_align() to recognize a 0x prefix for hexadecimals. Signed-off-by: Andreas Färber --- tools/fiptool/fiptool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fiptool/fiptool.c b/tools/fiptool/fiptool.c index 542a94666..0503696b8 100644 --- a/tools/fiptool/fiptool.c +++ b/tools/fiptool/fiptool.c @@ -646,7 +646,7 @@ static unsigned long get_image_align(char *arg) unsigned long align; errno = 0; - align = strtoul(arg, &endptr, 10); + align = strtoul(arg, &endptr, 0); if (*endptr != '\0' || !is_power_of_2(align) || errno != 0) log_errx("Invalid alignment: %s", arg);