The branch main has been updated by bdrewery:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cddb9806b50b49722140d7b30c09643376feeaed

commit cddb9806b50b49722140d7b30c09643376feeaed
Author:     Bryan Drewery <[email protected]>
AuthorDate: 2025-09-17 21:23:19 +0000
Commit:     Bryan Drewery <[email protected]>
CommitDate: 2025-09-17 21:28:18 +0000

    syslogd: Make some code more clear.
    
    This moves some math to where it logically makes more sense for skipping
    over the ": " separator in the message formatted "app[PID]: MSG".
    
    No functional change.
    
    Fixes:          18bcf5a0 ("Restore local kernel "prog" filtering")
    Sponsored by:   Dell Inc.
---
 usr.sbin/syslogd/syslogd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 81bbbbe66be8..e06464c0e749 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1185,13 +1185,15 @@ parsemsg_rfc3164_app_name_procid(char **msg, const char 
**app_name,
 
        /* Split strings from input. */
        app_name_begin[app_name_length] = '\0';
-       m += app_name_length + 1;
+       m += app_name_length;
        if (procid_begin != NULL) {
                procid_begin[procid_length] = '\0';
+               /* Skip "[PID]". */
                m += procid_length + 2;
        }
 
-       *msg = m + 1;
+       /* Skip separator ": ". */
+       *msg = m + 2;
        *app_name = app_name_begin;
        *procid = procid_begin;
        return;

Reply via email to