Merge "logcat: test: tail_# occasional failures"
diff --git a/logcat/tests/logcat_test.cpp b/logcat/tests/logcat_test.cpp
index dad74ee..0895834 100644
--- a/logcat/tests/logcat_test.cpp
+++ b/logcat/tests/logcat_test.cpp
@@ -208,9 +208,9 @@
         if ((*ep != '-') && (*ep != '.')) {
             continue;
         }
-        // Find PID field
+        // Find PID field.  Look for ': ' or ':[0-9][0-9][0-9]'
         while (((ep = strchr(ep, ':'))) && (*++ep != ' ')) {
-            ;
+            if (isdigit(ep[0]) && isdigit(ep[1]) && isdigit(ep[2])) break;
         }
         if (!ep) {
             continue;