Skip to content

Commit 3f23e6b

Browse files
Yasuo Ohgakibukka
Yasuo Ohgaki
authored andcommitted
Enable 0 mode for echo/print
1 parent e3d9f1f commit 3f23e6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static PHP_INI_MH(OnSetPrecision)
131131
zend_long i;
132132

133133
ZEND_ATOL(i, ZSTR_VAL(new_value));
134-
if (i >= 0) {
134+
if (i >= -1) {
135135
EG(precision) = i;
136136
return SUCCESS;
137137
} else {

main/spprintf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
306306
} else if (*fmt == '*') {
307307
precision = va_arg(ap, int);
308308
fmt++;
309-
if (precision < 0)
310-
precision = 0;
309+
if (precision < -1)
310+
precision = -1;
311311
} else
312312
precision = 0;
313313

0 commit comments

Comments
 (0)