diff options
Diffstat (limited to 'coreutils/printf.c')
-rw-r--r-- | coreutils/printf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coreutils/printf.c b/coreutils/printf.c index a666ff7ac..b2429c5cf 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c | |||
@@ -191,6 +191,7 @@ static void print_direc(char *format, unsigned fmt_length, | |||
191 | if (have_width - 1 == have_prec) | 191 | if (have_width - 1 == have_prec) |
192 | have_width = NULL; | 192 | have_width = NULL; |
193 | 193 | ||
194 | /* multiconvert sets errno = 0, but %s needs it cleared */ | ||
194 | errno = 0; | 195 | errno = 0; |
195 | 196 | ||
196 | switch (format[fmt_length - 1]) { | 197 | switch (format[fmt_length - 1]) { |
@@ -199,7 +200,7 @@ static void print_direc(char *format, unsigned fmt_length, | |||
199 | break; | 200 | break; |
200 | case 'd': | 201 | case 'd': |
201 | case 'i': | 202 | case 'i': |
202 | llv = my_xstrtoll(argument); | 203 | llv = my_xstrtoll(skip_whitespace(argument)); |
203 | print_long: | 204 | print_long: |
204 | if (!have_width) { | 205 | if (!have_width) { |
205 | if (!have_prec) | 206 | if (!have_prec) |
@@ -217,7 +218,7 @@ static void print_direc(char *format, unsigned fmt_length, | |||
217 | case 'u': | 218 | case 'u': |
218 | case 'x': | 219 | case 'x': |
219 | case 'X': | 220 | case 'X': |
220 | llv = my_xstrtoull(argument); | 221 | llv = my_xstrtoull(skip_whitespace(argument)); |
221 | /* cheat: unsigned long and long have same width, so... */ | 222 | /* cheat: unsigned long and long have same width, so... */ |
222 | goto print_long; | 223 | goto print_long; |
223 | case 's': | 224 | case 's': |