From 1263e36feae22277e55d819be1c0e998060de12f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 19:56:33 +0100 Subject: Cleanup: Use strtoul for numeric conversion --- src/ClashAvoider.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp index c125db0b..293b9867 100644 --- a/src/ClashAvoider.cpp +++ b/src/ClashAvoider.cpp @@ -55,7 +55,9 @@ ClashAvoider::map_path(const Raul::Path& in) const size_t pos = in.find_last_of('_'); if (pos != std::string::npos && pos != (in.length()-1)) { const std::string trailing = in.substr(pos + 1); - has_offset = (sscanf(trailing.c_str(), "%u", &offset) > 0); + char* end = nullptr; + strtoul(trailing.c_str(), &end, 10); + has_offset = (*end == '\0'); } // Path without _n suffix -- cgit v1.2.1