From 6df55c9156d939e8f6cbf0919edbabbbf5883d02 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Nov 2015 21:33:07 -0500 Subject: [PATCH] Variant: Converted from strtol/substr to std::stoi/std::compare --- src/Variant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Variant.cpp b/src/Variant.cpp index 6d0434468..66f3e10b9 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -1871,7 +1871,7 @@ void Variant::cast (const enum type new_type) _string == "0.0") ? false : true; break; case type_integer: - _integer = (int) strtol (_string.c_str (), NULL, (_string.substr (0, 2) == "0x" ? 16 : 10)); + _integer = std::stoi (_string, NULL, (_string.compare (0, 2, "0x", 2) ? 10 : 16)); break; case type_real: _real = std::stod (_string); break; case type_string: break;