com php-src: fixed alternate form for 'x' and 'X' formats: main/spprintf.c
| From: | Arnaud Le Blanc | Date: | Sun, 13 Jan 2013 14:45:15 +0000 |
| Subject: | com php-src: fixed alternate form for 'x' and 'X' formats: main/spprintf.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70930@lists.php.net to get a copy of this message | ||
Commit: a06313fe5ab49b20bdafbae6b000bda8d9ca3176
Author: Arnaud Le Blanc <arnaud.lb@gmail.com> Sun, 13 Jan 2013 15:45:15 +0100
Parents: 046ae2f77ca36366008690edc4b35ddd2c8f9fc7
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a06313fe5ab49b20bdafbae6b000bda8d9ca3176
Log:
fixed alternate form for 'x' and 'X' formats
same fix exists in original code:
https://svn.apache.org/viewvc?view=revision&revision=1152309
Changed paths:
M main/spprintf.c
Diff:
diff --git a/main/spprintf.c b/main/spprintf.c
index bb401ab..596e1ef 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -211,7 +211,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
double fp_num;
wide_int i_num = (wide_int) 0;
- u_wide_int ui_num;
+ u_wide_int ui_num = (u_wide_int) 0;
char num_buf[NUM_BUF_SIZE];
char char_buf[2]; /* for printing %% and %<unknown> */
@@ -560,7 +560,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
s = ap_php_conv_p2(ui_num, 4, *fmt,
&num_buf[NUM_BUF_SIZE], &s_len);
FIX_PRECISION(adjust_precision, precision, s, s_len);
- if (alternate_form && i_num != 0) {
+ if (alternate_form && ui_num != 0) {
*--s = *fmt; /* 'x' or 'X' */
*--s = '0';
s_len += 2;