summaryrefslogtreecommitdiff
path: root/cmds/idmap2
diff options
context:
space:
mode:
author Ryan Mitchell <rtmitchell@google.com> 2019-06-04 08:14:36 -0700
committer android-build-merger <android-build-merger@google.com> 2019-06-04 08:14:36 -0700
commitab3e54dc8aa2b2e75e0cc4b8818d25d57f7c9ccd (patch)
treee14f12760b38784549c188a4fc42b863e1091fc3 /cmds/idmap2
parent2447bb6e8e2f798d4948058c9abbaf9f332379ee (diff)
parent9fe4ba7a435725eda5d7f12d804633ff858ebb71 (diff)
Merge "Fix atoi build errors" into qt-dev
am: 9fe4ba7a43 Change-Id: I9617284d09ec85c699d12045a8761b97b226b795
Diffstat (limited to 'cmds/idmap2')
-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;
}