Loading logcat/logcat.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -807,7 +807,10 @@ int main(int argc, char **argv) // squash out the byte count // squash out the byte count cp = buf; cp = buf; if (!truncated) { if (!truncated) { while (isdigit(*cp) || (*cp == '\n')) { while (isdigit(*cp)) { ++cp; } if (*cp == '\n') { ++cp; ++cp; } } } } Loading logcat/tests/logcat_test.cpp +11 −1 Original line number Original line Diff line number Diff line Loading @@ -601,7 +601,7 @@ TEST(logcat, white_black_adjust) { ASSERT_EQ(true, get_white_black(&list)); ASSERT_EQ(true, get_white_black(&list)); static const char adjustment[] = "~! ~1000"; static const char adjustment[] = "~! 300/20 300/25 2000 ~1000/5 ~1000/30"; ASSERT_EQ(true, set_white_black(adjustment)); ASSERT_EQ(true, set_white_black(adjustment)); ASSERT_EQ(true, get_white_black(&adjust)); ASSERT_EQ(true, get_white_black(&adjust)); if (strcmp(adjustment, adjust)) { if (strcmp(adjustment, adjust)) { Loading @@ -611,6 +611,16 @@ TEST(logcat, white_black_adjust) { free(adjust); free(adjust); adjust = NULL; adjust = NULL; static const char adjustment2[] = "300/20 300/21 2000 ~1000"; ASSERT_EQ(true, set_white_black(adjustment2)); ASSERT_EQ(true, get_white_black(&adjust)); if (strcmp(adjustment2, adjust)) { fprintf(stderr, "ERROR: '%s' != '%s'\n", adjustment2, adjust); } ASSERT_STREQ(adjustment2, adjust); free(adjust); adjust = NULL; ASSERT_EQ(true, set_white_black(list)); ASSERT_EQ(true, set_white_black(list)); ASSERT_EQ(true, get_white_black(&adjust)); ASSERT_EQ(true, get_white_black(&adjust)); if (strcmp(list, adjust)) { if (strcmp(list, adjust)) { Loading logd/LogListener.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -95,7 +95,9 @@ bool LogListener::onDataAvailable(SocketClient *cli) { msg += sizeof(log_time); msg += sizeof(log_time); n -= sizeof(log_time); n -= sizeof(log_time); unsigned short len = n; // NB: hdr.msg_flags & MSG_TRUNC is not tested, silently passing a // truncated message to the logs. unsigned short len = n; // cap to internal maximum if (len == n) { if (len == n) { logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, len); logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, len); reader->notifyNewLog(); reader->notifyNewLog(); Loading logd/LogWhiteBlackList.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -154,8 +154,8 @@ int PruneList::init(char *str) { } } m = pid - p->mPid; m = pid - p->mPid; } } if (m >= 0) { if (m <= 0) { if (m > 0) { if (m < 0) { list->insert(it, new Prune(uid,pid)); list->insert(it, new Prune(uid,pid)); } } break; break; Loading Loading
logcat/logcat.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -807,7 +807,10 @@ int main(int argc, char **argv) // squash out the byte count // squash out the byte count cp = buf; cp = buf; if (!truncated) { if (!truncated) { while (isdigit(*cp) || (*cp == '\n')) { while (isdigit(*cp)) { ++cp; } if (*cp == '\n') { ++cp; ++cp; } } } } Loading
logcat/tests/logcat_test.cpp +11 −1 Original line number Original line Diff line number Diff line Loading @@ -601,7 +601,7 @@ TEST(logcat, white_black_adjust) { ASSERT_EQ(true, get_white_black(&list)); ASSERT_EQ(true, get_white_black(&list)); static const char adjustment[] = "~! ~1000"; static const char adjustment[] = "~! 300/20 300/25 2000 ~1000/5 ~1000/30"; ASSERT_EQ(true, set_white_black(adjustment)); ASSERT_EQ(true, set_white_black(adjustment)); ASSERT_EQ(true, get_white_black(&adjust)); ASSERT_EQ(true, get_white_black(&adjust)); if (strcmp(adjustment, adjust)) { if (strcmp(adjustment, adjust)) { Loading @@ -611,6 +611,16 @@ TEST(logcat, white_black_adjust) { free(adjust); free(adjust); adjust = NULL; adjust = NULL; static const char adjustment2[] = "300/20 300/21 2000 ~1000"; ASSERT_EQ(true, set_white_black(adjustment2)); ASSERT_EQ(true, get_white_black(&adjust)); if (strcmp(adjustment2, adjust)) { fprintf(stderr, "ERROR: '%s' != '%s'\n", adjustment2, adjust); } ASSERT_STREQ(adjustment2, adjust); free(adjust); adjust = NULL; ASSERT_EQ(true, set_white_black(list)); ASSERT_EQ(true, set_white_black(list)); ASSERT_EQ(true, get_white_black(&adjust)); ASSERT_EQ(true, get_white_black(&adjust)); if (strcmp(list, adjust)) { if (strcmp(list, adjust)) { Loading
logd/LogListener.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -95,7 +95,9 @@ bool LogListener::onDataAvailable(SocketClient *cli) { msg += sizeof(log_time); msg += sizeof(log_time); n -= sizeof(log_time); n -= sizeof(log_time); unsigned short len = n; // NB: hdr.msg_flags & MSG_TRUNC is not tested, silently passing a // truncated message to the logs. unsigned short len = n; // cap to internal maximum if (len == n) { if (len == n) { logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, len); logbuf->log(log_id, realtime, cred->uid, cred->pid, tid, msg, len); reader->notifyNewLog(); reader->notifyNewLog(); Loading
logd/LogWhiteBlackList.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -154,8 +154,8 @@ int PruneList::init(char *str) { } } m = pid - p->mPid; m = pid - p->mPid; } } if (m >= 0) { if (m <= 0) { if (m > 0) { if (m < 0) { list->insert(it, new Prune(uid,pid)); list->insert(it, new Prune(uid,pid)); } } break; break; Loading