From 71b291733aeb08f44cdd43386222f1f777a083e6 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Wed, 18 Oct 2017 23:55:39 -0700 Subject: [PATCH] Fix failing ConfigTest When running in cloud, different version of STL library is used. It throws exceptions and make tests fail. Bug: 67963594 Test: ConfigTest Change-Id: Ie53b82e5d670f44a2460880c32dd9102d1caad7d --- osi/src/config.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osi/src/config.cc b/osi/src/config.cc index aa252361b..c5b6b8973 100644 --- a/osi/src/config.cc +++ b/osi/src/config.cc @@ -109,9 +109,9 @@ int config_get_int(const config_t& config, const std::string& section, const entry_t* entry = entry_find(config, section, key); if (!entry) return def_value; - size_t endptr; - int ret = stoi(entry->value, &endptr, 0); - return (endptr == entry->value.size()) ? ret : def_value; + char* endptr; + int ret = strtol(entry->value.c_str(), &endptr, 0); + return (*endptr == '\0') ? ret : def_value; } bool config_get_bool(const config_t& config, const std::string& section, -- 2.11.0