X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/38700c7f24646dfbc6ac0ed529d3ed727c545cd0..a58370c17f5227919bb1e9619a6a413a90d3fa45:/print-syslog.c diff --git a/print-syslog.c b/print-syslog.c index 2d481815..4f613f0a 100644 --- a/print-syslog.c +++ b/print-syslog.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2004 Hannes Gredler + * Copyright (c) 1998-2004 Hannes Gredler * The TCPDUMP project * * Redistribution and use in source and binary forms, with or without @@ -14,13 +14,15 @@ * FOR A PARTICULAR PURPOSE. */ +/* \summary: Syslog protocol printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include -#include "interface.h" +#include "netdissect.h" #include "extract.h" static const char tstr[] = "[|syslog]"; @@ -92,9 +94,9 @@ syslog_print(netdissect_options *ndo, if (*(pptr+msg_off) == '<') { msg_off++; ND_TCHECK2(*(pptr + msg_off), 1); - while ( *(pptr+msg_off) >= '0' && - *(pptr+msg_off) <= '9' && - msg_off <= SYSLOG_MAX_DIGITS) { + while (msg_off <= SYSLOG_MAX_DIGITS && + *(pptr+msg_off) >= '0' && + *(pptr+msg_off) <= '9') { pri = pri * 10 + (*(pptr+msg_off) - '0'); msg_off++; ND_TCHECK2(*(pptr + msg_off), 1);