diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-04 01:30:32 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-04 01:30:32 +0000 |
commit | dadf7907b20a305127c5e7f3adb0ba3f69a0b0b0 (patch) | |
tree | 7f18d658127ea00162efc17a4a40e85cab8a1de3 | |
parent | 22f180fd6c1f8186dea0ba4ee1451b5241051b5e (diff) | |
download | busybox-w32-dadf7907b20a305127c5e7f3adb0ba3f69a0b0b0.tar.gz busybox-w32-dadf7907b20a305127c5e7f3adb0ba3f69a0b0b0.tar.bz2 busybox-w32-dadf7907b20a305127c5e7f3adb0ba3f69a0b0b0.zip |
printf: fix breakage in handling '*'
-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 b0a48cda4..ca8e51cf2 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); |