diff options
author | Denis Vlasenko | 2009-03-03 14:14:44 +0000 |
---|---|---|
committer | Denis Vlasenko | 2009-03-03 14:14:44 +0000 |
commit | 6852effbc22fa3e7fda34eff7bc245bd211e1287 (patch) | |
tree | e2b4cd392101cf0b3ec9bd24c13680646f5052c1 | |
parent | 248ce91017cdc5ea8bdc496ebbbc8f3e97ab298d (diff) | |
download | busybox-6852effbc22fa3e7fda34eff7bc245bd211e1287.zip busybox-6852effbc22fa3e7fda34eff7bc245bd211e1287.tar.gz |
printf: fix 1.12.0 breakage (from %*d fix). It was misinterpreting "*"
-rw-r--r-- | coreutils/printf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/printf.c b/coreutils/printf.c index d4f1de9..0b004ea 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c @@ -139,14 +139,14 @@ static void print_direc(char *format, unsigned fmt_length, char saved; char *have_prec, *have_width; + saved = format[fmt_length]; + format[fmt_length] = '\0'; + have_prec = strstr(format, ".*"); have_width = strchr(format, '*'); if (have_width - 1 == have_prec) have_width = NULL; - saved = format[fmt_length]; - format[fmt_length] = '\0'; - switch (format[fmt_length - 1]) { case 'c': printf(format, *argument); |