From: Lukas Funke <[email protected]>

Correctly parse the field width from the format specifier. Before this
commit the field_width was simply ignored.

Signed-off-by: Lukas Funke <[email protected]>
---

(no changes since v1)

 cmd/printf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/printf.c b/cmd/printf.c
index 0c6887e0d6..f56543b79e 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;
                                }
                        }
-- 
2.30.2

Reply via email to