Skip to content

Commit a06313f

Browse files
committed
fixed alternate form for 'x' and 'X' formats
same fix exists in original code: https://svn.apache.org/viewvc?view=revision&revision=1152309
1 parent 046ae2f commit a06313f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/spprintf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
211211

212212
double fp_num;
213213
wide_int i_num = (wide_int) 0;
214-
u_wide_int ui_num;
214+
u_wide_int ui_num = (u_wide_int) 0;
215215

216216
char num_buf[NUM_BUF_SIZE];
217217
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)
560560
s = ap_php_conv_p2(ui_num, 4, *fmt,
561561
&num_buf[NUM_BUF_SIZE], &s_len);
562562
FIX_PRECISION(adjust_precision, precision, s, s_len);
563-
if (alternate_form && i_num != 0) {
563+
if (alternate_form && ui_num != 0) {
564564
*--s = *fmt; /* 'x' or 'X' */
565565
*--s = '0';
566566
s_len += 2;

0 commit comments

Comments
 (0)