Skip to content

Commit

Permalink
fixing magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Tylerlhess committed Dec 13, 2024
1 parent bff5078 commit f2b6968
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/analysisd/cleanevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ int OS_CleanMSG(char *msg, Eventinfo *lf)
if (pieces[0] == '<') {
/* Increment past the < */
pieces++;
/*move past the 1-3 digits */
/*move past the 1-3 digits
Increment lf->log along the way */
while (isdigit((int)*pieces)) {
pieces++;
lf->log++;
}
if (
(pieces[0] == '>') &&
Expand All @@ -117,12 +119,13 @@ int OS_CleanMSG(char *msg, Eventinfo *lf)
pieces += 2;
pieces[0] = '\0';
pieces++;
lf->log += 6;
lf->log += 3;
} else {
/* Walk back to the beginning as not Syslog protocol 23 */
pieces--;
while (isdigit((int)*pieces)) {
pieces--;
lf->log--;
}

}
Expand Down

0 comments on commit f2b6968

Please sign in to comment.