X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ed85e20e4d6a27d5405f37366dd34b64c10a9211..a58370c17f5227919bb1e9619a6a413a90d3fa45:/print-syslog.c diff --git a/print-syslog.c b/print-syslog.c index 5e3cd4f7..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,14 +14,15 @@ * FOR A PARTICULAR PURPOSE. */ -#define NETDISSECT_REWORKED +/* \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]"; @@ -93,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);