diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-03 14:14:44 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-03 14:14:44 +0000 |
| commit | 6852effbc22fa3e7fda34eff7bc245bd211e1287 (patch) | |
| tree | e2b4cd392101cf0b3ec9bd24c13680646f5052c1 /coreutils | |
| parent | 248ce91017cdc5ea8bdc496ebbbc8f3e97ab298d (diff) | |
| download | busybox-w32-6852effbc22fa3e7fda34eff7bc245bd211e1287.tar.gz busybox-w32-6852effbc22fa3e7fda34eff7bc245bd211e1287.tar.bz2 busybox-w32-6852effbc22fa3e7fda34eff7bc245bd211e1287.zip | |
printf: fix 1.12.0 breakage (from %*d fix). It was misinterpreting "*"
Diffstat (limited to 'coreutils')
| -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 d4f1de99b..0b004eaeb 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c | |||
| @@ -139,14 +139,14 @@ static void print_direc(char *format, unsigned fmt_length, | |||
| 139 | char saved; | 139 | char saved; |
| 140 | char *have_prec, *have_width; | 140 | char *have_prec, *have_width; |
| 141 | 141 | ||
| 142 | saved = format[fmt_length]; | ||
| 143 | format[fmt_length] = '\0'; | ||
| 144 | |||
| 142 | have_prec = strstr(format, ".*"); | 145 | have_prec = strstr(format, ".*"); |
| 143 | have_width = strchr(format, '*'); | 146 | have_width = strchr(format, '*'); |
| 144 | if (have_width - 1 == have_prec) | 147 | if (have_width - 1 == have_prec) |
| 145 | have_width = NULL; | 148 | have_width = NULL; |
| 146 | 149 | ||
| 147 | saved = format[fmt_length]; | ||
| 148 | format[fmt_length] = '\0'; | ||
| 149 | |||
| 150 | switch (format[fmt_length - 1]) { | 150 | switch (format[fmt_length - 1]) { |
| 151 | case 'c': | 151 | case 'c': |
| 152 | printf(format, *argument); | 152 | printf(format, *argument); |
