From f339672b89d4acfed76049cdecce6a4e74e01327 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Nov 2015 18:36:37 -0500 Subject: [PATCH] Variant: Converted from sprintf to std::to_string --- src/Variant.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Variant.cpp b/src/Variant.cpp index 410bfc1d5..515999238 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -1837,15 +1837,9 @@ void Variant::cast (const enum type new_type) case type_boolean: _bool = _integer == 0 ? false : true; break; case type_integer: break; case type_real: _real = static_cast(_integer); break; - case type_string: - { - char temp[24]; - sprintf (temp, "%d", _integer); - _string = temp; - } - break; - case type_date: _date = (time_t) _integer; break; - case type_duration: _duration = (time_t) _integer; break; + case type_string: _string = std::to_string (_integer); break; + case type_date: _date = (time_t) _integer; break; + case type_duration: _duration = (time_t) _integer; break; } break;