aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Funke <lukas.funke@weidmueller.com>2024-01-10 10:10:31 +0100
committerTom Rini <trini@konsulko.com>2024-01-18 10:42:14 -0500
commiteb131698af98bf2cbe021cb97d4d26c993a462cc (patch)
treea591e8546118c44fbd6c141b1a279f441c05a53d
parent8db87682a8fc23c3ea099aa03be165d7647aeba9 (diff)
downloadu-boot-eb131698af98bf2cbe021cb97d4d26c993a462cc.zip
u-boot-eb131698af98bf2cbe021cb97d4d26c993a462cc.tar.gz
u-boot-eb131698af98bf2cbe021cb97d4d26c993a462cc.tar.bz2
cmd: printf: Correctly handle field width
Correctly parse the field width from the format specifier. Before this commit the field_width was simply ignored. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
-rw-r--r--cmd/printf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/printf.c b/cmd/printf.c
index 0c6887e..f56543b 100644
--- a/cmd/printf.c
+++ b/cmd/printf.c
@@ -517,7 +517,7 @@ static char **print_formatted(struct print_inf *inf, char *f, char **argv, int *
field_width = get_width_prec(*argv++);
} else {
while (isdigit(*f)) {
- ++f;
+ field_width = field_width * 10 + *(f++) - '0';
++direc_length;
}
}