Trim whitespace from sysfs values.
Test: builds, boots
Bug: 72740079
Change-Id: If364927ea762c7dee99bff5dc307e3b9b5355c2b
diff --git a/model/Disk.cpp b/model/Disk.cpp
index 9fcf5e1..d7b19ac 100644
--- a/model/Disk.cpp
+++ b/model/Disk.cpp
@@ -257,6 +257,7 @@
PLOG(WARNING) << "Failed to read vendor from " << path;
return -errno;
}
+ tmp = android::base::Trim(tmp);
mLabel = tmp;
break;
}
@@ -267,6 +268,7 @@
PLOG(WARNING) << "Failed to read manufacturer from " << path;
return -errno;
}
+ tmp = android::base::Trim(tmp);
int64_t manfid;
if (!android::base::ParseInt(tmp, &manfid)) {
PLOG(WARNING) << "Failed to parse manufacturer " << tmp;