Move off std::sto* function which abort on failure.
Bug: http://b/31403370
Test: builds, boots, libbase tests pass
Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp
index 0ab4c98..e5ddab3 100644
--- a/bootstat/bootstat.cpp
+++ b/bootstat/bootstat.cpp
@@ -60,7 +60,7 @@
BootEventRecordStore boot_event_store;
if (!value_str.empty()) {
int32_t value = 0;
- if (android::base::ParseInt(value_str.c_str(), &value)) {
+ if (android::base::ParseInt(value_str, &value)) {
boot_event_store.AddBootEventWithValue(event, value);
}
} else {
@@ -193,7 +193,7 @@
std::string build_date_str = GetProperty("ro.build.date.utc");
int32_t build_date;
- if (!android::base::ParseInt(build_date_str.c_str(), &build_date)) {
+ if (!android::base::ParseInt(build_date_str, &build_date)) {
return std::string();
}