Avoid moving onto a new line while testing if there is a syslog priority

in the buffer. This isn't exactly the patch that Stephen submitted, but
is based on one of his suggestions.

PR:		93841
Submitted by:	Stephen Montgomery-Smith <stephen@math.missouri.edu>
MFC after:	2 weeks
This commit is contained in:
David Malone 2006-02-27 19:13:47 +00:00
parent ebecf80294
commit 48697608f1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156076

View file

@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/msgbuf.h>
#include <sys/sysctl.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@ -177,7 +178,7 @@ main(int argc, char *argv[])
nextp++;
/* Skip ^<[0-9]+> syslog sequences. */
if (*p == '<') {
if (*p == '<' && isdigit(*(p+1))) {
errno = 0;
pri = strtol(p + 1, &q, 10);
if (*q == '>' && pri >= 0 && pri < INT_MAX &&