Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48ff04f9 authored by Nick Kralevich's avatar Nick Kralevich Committed by android-build-merger
Browse files

Merge "LogAudit.cpp: replace newlines with spaces in audit messages" am: 5badada9

am: 5083c589

Change-Id: Ic41ed573f2ee717edb347ef1db28daa6ab20de07
parents 3322aaf1 5083c589
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -98,6 +98,13 @@ int LogAudit::logPrint(const char *fmt, ...) {
    }

    char *cp;
    // Work around kernels missing
    // https://github.com/torvalds/linux/commit/b8f89caafeb55fba75b74bea25adc4e4cd91be67
    // Such kernels improperly add newlines inside audit messages.
    while ((cp = strchr(str, '\n'))) {
        *cp = ' ';
    }

    while ((cp = strstr(str, "  "))) {
        memmove(cp, cp + 1, strlen(cp + 1) + 1);
    }