Address post review comments regarding ParseClassPath.
Change-Id: Iffa58395271f6a65c1d939581f8c2711076f036c
diff --git a/src/runtime.cc b/src/runtime.cc
index 18b001e..5857c3a 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -51,12 +51,14 @@
// notreached
}
+// Splits a colon delimited list of pathname elements into a vector of
+// strings. Empty strings will be omitted.
void ParseClassPath(const char* class_path, std::vector<std::string>* vec) {
CHECK(vec != NULL);
scoped_ptr_malloc<char> tmp(strdup(class_path));
char* full = tmp.get();
char* p = full;
- while (p) {
+ while (p != NULL) {
p = strpbrk(full, ":");
if (p != NULL) {
p[0] = '\0';
@@ -64,7 +66,7 @@
if (full[0] != '\0') {
vec->push_back(std::string(full));
}
- if (p) {
+ if (p != NULL) {
full = p + 1;
}
}