diff options
author | D G Turner | 2017-01-12 04:50:45 +0000 |
---|---|---|
committer | D G Turner | 2017-01-12 04:50:45 +0000 |
commit | 70d372603410794d2b7a1c4395423e551fe3e1f7 (patch) | |
tree | 66df8c05355de3d50e84816d52033e83f3d2032b /common/json.cpp | |
parent | 64a3f893d1c06332b1013c05342e47d65e1b34c6 (diff) | |
download | scummvm-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.cpp | 8 |
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; } |