summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_utils.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-06-19 16:20:02 +0100
committerJakub Zelenka <bukka@php.net>2016-06-19 16:20:02 +0100
commitc2b90805e81de43b4fa28fa1b30ed255bfba76b2 (patch)
treea353bb7b1cb958fd4f3e576ab44f3b6ef03a02c2 /sapi/phpdbg/phpdbg_utils.c
parentb44cf1a8540d321583a0d83ebca688ebab10d3b0 (diff)
parentd0e84c6f4702dc5dda473851dd33c5e6cee82ee6 (diff)
downloadphp-git-c2b90805e81de43b4fa28fa1b30ed255bfba76b2.tar.gz
Merge branch 'master' into openssl_error_store
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.c')
-rw-r--r--sapi/phpdbg/phpdbg_utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 7158f3ba6c..6f42665809 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -804,6 +804,18 @@ char *phpdbg_short_zval_print(zval *zv, int maxlen) /* {{{ */
break;
case IS_DOUBLE:
spprintf(&decode, 0, "%.*G", 14, Z_DVAL_P(zv));
+
+ /* Make sure it looks like a float */
+ if (zend_finite(Z_DVAL_P(zv)) && !strchr(decode, '.')) {
+ size_t len = strlen(decode);
+ char *decode2 = emalloc(len + strlen(".0") + 1);
+ memcpy(decode2, decode, len);
+ decode2[len] = '.';
+ decode2[len+1] = '0';
+ decode2[len+2] = '\0';
+ efree(decode);
+ decode = decode2;
+ }
break;
case IS_STRING: {
int i;