diff options
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 7ad144331..b6251a378 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -66,10 +66,10 @@ std::string &toUpper(std::string &str) unsigned int atox(const std::string &str) { - unsigned int value; - sscanf(str.c_str(), "0x%06x", &value); - - return value; + unsigned int value = 0; + if (sscanf(str.c_str(), "0x%06x", &value)) + return value; + return 0; } const char *ipToString(const uint32_t address) |