diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-10-26 22:18:40 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-10-26 22:18:40 +0000 |
commit | d88775c5ae38be7d85a062afc3db25b6a20b8617 (patch) | |
tree | f1746ad9f6fe609f9df4a72c559a0715f617a7b3 | |
parent | d5870ef54440591433e16ef5439424b7e92c155d (diff) | |
download | php-git-d88775c5ae38be7d85a062afc3db25b6a20b8617.tar.gz |
Better fix for bug #20108.
-rw-r--r-- | ext/standard/formatted_print.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index fc064aac69..81dc808948 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -159,6 +159,10 @@ php_sprintf_appendstring(char **buffer, int *pos, int *size, char *add, { register int npad; + if (max_width && min_width) { + expprec = max_width = 0; + } + npad = min_width - MIN(len, (expprec ? max_width : len)); if (npad < 0) { @@ -605,10 +609,10 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC) convert_to_string_ex(args[argnum]); php_sprintf_appendstring(&result, &outpos, &size, Z_STRVAL_PP(args[argnum]), - width, 0, padding, + width, precision, padding, alignment, Z_STRLEN_PP(args[argnum]), - 0, 0); + 0, expprec); break; case 'd': |