]> granicus.if.org Git - php/commitdiff
Add cast
authorYasuo Ohgaki <yohgaki@php.net>
Mon, 31 Aug 2015 07:10:32 +0000 (16:10 +0900)
committerJakub Zelenka <bukka@php.net>
Sun, 26 Jun 2016 12:26:43 +0000 (13:26 +0100)
ext/json/json_encoder.c

index b797e7da3d639575abbbfadc8eda19007048b09a..48d082a031769fa4a9705bf7ffcbee155d091952 100644 (file)
@@ -105,7 +105,7 @@ static inline void php_json_encode_double(smart_str *buf, double d, int options)
        size_t len;
        char num[PHP_JSON_DOUBLE_MAX_LENGTH];
 
-       php_gcvt(d, JSON_G(precision), '.', 'e', num);
+       php_gcvt(d, (int)JSON_G(precision), '.', 'e', num);
        len = strlen(num);
        if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < PHP_JSON_DOUBLE_MAX_LENGTH - 2) {
                num[len++] = '.';