summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/idmap2/idmap2/Scan.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp
index 21c6bd280064..cfac5f31e2e6 100644
--- a/cmds/idmap2/idmap2/Scan.cpp
+++ b/cmds/idmap2/idmap2/Scan.cpp
@@ -69,7 +69,10 @@ struct InputOverlay {
bool VendorIsQOrLater() {
constexpr int kQSdkVersion = 29;
- int version = std::atoi(android::base::GetProperty("ro.vndk.version", "29").data());
+ constexpr int kBase = 10;
+ std::string version_prop = android::base::GetProperty("ro.vndk.version", "29");
+ int version = strtol(version_prop.data(), nullptr, kBase);
+
// If the string cannot be parsed, it is a development sdk codename.
return version >= kQSdkVersion || version == 0;
}