Clean up maps parsing in libbacktrace.
(This might want to be unified with the very similar code in bionic, but
that's a job for another day.)
Change-Id: I5dade498f781305fa9909ee01f1f4bebc537c169
diff --git a/libbacktrace/BacktraceMap.cpp b/libbacktrace/BacktraceMap.cpp
index ca47f67..4c6c96e 100644
--- a/libbacktrace/BacktraceMap.cpp
+++ b/libbacktrace/BacktraceMap.cpp
@@ -63,7 +63,7 @@
// 6f000000-6f01e000 rwxp 00000000 00:0c 16389419 /system/lib/libcomposer.so\n
// 012345678901234567890123456789012345678901234567890123456789
// 0 1 2 3 4 5
- if (sscanf(line, "%lx-%lx %4s %*x %*x:%*x %*d%n",
+ if (sscanf(line, "%lx-%lx %4s %*x %*x:%*x %*d %n",
&start, &end, permissions, &name_pos) != 3) {
#endif
return false;
@@ -82,9 +82,6 @@
map->flags |= PROT_EXEC;
}
- while (isspace(line[name_pos])) {
- name_pos += 1;
- }
map->name = line+name_pos;
if (!map->name.empty() && map->name[map->name.length()-1] == '\n') {
map->name.erase(map->name.length()-1);