diff options
author | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
commit | e63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch) | |
tree | b83a144eec24cc81adab0b9a778f7a730d8df79e /sapi/phpdbg/phpdbg_utils.c | |
parent | 7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff) | |
parent | 53071e647049f099f7f7a0771ddb63fc2cdd621c (diff) | |
download | php-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz |
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_utils.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index a944d256ae..6f42665809 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -38,7 +38,7 @@ # endif #endif -ZEND_EXTERN_MODULE_GLOBALS(phpdbg); +ZEND_EXTERN_MODULE_GLOBALS(phpdbg) /* {{{ color structures */ const static phpdbg_color_t colors[] = { @@ -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; |