X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7b2c5a11a7bc236d72b440c4db5263edb23b4880..a7a76012a129ffefb64f102948db63fbc715e45e:/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);