summaryrefslogtreecommitdiff
path: root/main/snprintf.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2015-08-31 18:59:32 +0900
committerJakub Zelenka <bukka@php.net>2016-06-26 13:26:43 +0100
commitc71550472a003cdab67d85de8b5e57268df65531 (patch)
treed78fc0f82311ea9e3c9ebea9a24bcbfadb0eccbd /main/snprintf.c
parent5f5dc04fc26f47fbe5172e0517887ffe3a1ff6cc (diff)
downloadphp-git-c71550472a003cdab67d85de8b5e57268df65531.tar.gz
Fix mode when precision=0. Add test
Diffstat (limited to 'main/snprintf.c')
-rw-r--r--main/snprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/snprintf.c b/main/snprintf.c
index 80a5c6e249..678f879dc3 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -143,7 +143,7 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
{
char *digits, *dst, *src;
int i, decpt, sign;
- int mode = ndigit > 0 ? 2 : 0;
+ int mode = ndigit >= 0 ? 2 : 0;
if (mode == 0) {
ndigit = 17;