summaryrefslogtreecommitdiff
path: root/ext/json/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/json.c')
-rw-r--r--ext/json/json.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index 5b71eb06f6..16af796145 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -418,18 +418,14 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
if ((type = is_numeric_string(s, len, &p, &d, 0)) != 0) {
if (type == IS_LONG) {
smart_str_append_long(buf, p);
- } else if (type == IS_DOUBLE) {
- if (!zend_isinf(d) && !zend_isnan(d)) {
- char *tmp;
- int l = spprintf(&tmp, 0, "%.*k", (int) EG(precision), d);
- smart_str_appendl(buf, tmp, l);
- efree(tmp);
- } else {
- JSON_G(error_code) = PHP_JSON_ERROR_INF_OR_NAN;
- smart_str_appendc(buf, '0');
- }
+ return;
+ } else if (type == IS_DOUBLE && !zend_isinf(d) && !zend_isnan(d)) {
+ char *tmp;
+ int l = spprintf(&tmp, 0, "%.*k", (int) EG(precision), d);
+ smart_str_appendl(buf, tmp, l);
+ efree(tmp);
+ return;
}
- return;
}
}