summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-08 19:56:33 +0100
committerDavid Robillard <d@drobilla.net>2019-12-08 21:08:39 +0100
commit1263e36feae22277e55d819be1c0e998060de12f (patch)
treeca9ab216866c8b9686c3da600085c5a9024324d2
parent3f183ed0c46bf8d9a08e1c54f8218c1bf4106721 (diff)
downloadingen-1263e36feae22277e55d819be1c0e998060de12f.tar.gz
ingen-1263e36feae22277e55d819be1c0e998060de12f.tar.bz2
ingen-1263e36feae22277e55d819be1c0e998060de12f.zip
Cleanup: Use strtoul for numeric conversion
-rw-r--r--src/ClashAvoider.cpp4
1 files changed, 3 insertions, 1 deletions
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