aboutsummaryrefslogtreecommitdiff
path: root/common/json.cpp
diff options
context:
space:
mode:
authorD G Turner2017-01-12 04:50:45 +0000
committerD G Turner2017-01-12 04:50:45 +0000
commit70d372603410794d2b7a1c4395423e551fe3e1f7 (patch)
tree66df8c05355de3d50e84816d52033e83f3d2032b /common/json.cpp
parent64a3f893d1c06332b1013c05342e47d65e1b34c6 (diff)
downloadscummvm-rg350-70d372603410794d2b7a1c4395423e551fe3e1f7.tar.gz
scummvm-rg350-70d372603410794d2b7a1c4395423e551fe3e1f7.tar.bz2
scummvm-rg350-70d372603410794d2b7a1c4395423e551fe3e1f7.zip
COMMON: Replace sprintf() with safer String::format() in JSON module.
Diffstat (limited to 'common/json.cpp')
-rw-r--r--common/json.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/common/json.cpp b/common/json.cpp
index 792d1967e9..c8caf01519 100644
--- a/common/json.cpp
+++ b/common/json.cpp
@@ -979,17 +979,13 @@ String JSONValue::stringifyImpl(size_t const indentDepth) const {
if (isinf(_numberValue) || isnan(_numberValue))
ret_string = "null";
else {
- char str[80];
- sprintf(str, "%g", _numberValue);
- ret_string = str;
+ ret_string = String::format("%g", _numberValue);
}
break;
}
case JSONType_IntegerNumber: {
- char str[80];
- sprintf(str, "%lld", _integerValue);
- ret_string = str;
+ ret_string = String::format("%lld", _integerValue);
break;
}