]> The Tcpdump Group git mirrors - tcpdump/commit
fix parsing of syslog priority (GH #264)
authorBram <[email protected]>
Tue, 28 Sep 2010 09:32:14 +0000 (11:32 +0200)
committerDenis Ovsienko <[email protected]>
Thu, 12 Sep 2013 17:14:16 +0000 (21:14 +0400)
commitd44f963e59ead8486d097f890ec8ca7c3000a8af
treef627418cf1605a5f005545af3c24fcb61df57656
parentf5acc04bef89751b57441dcdac7a86b8f981989b
fix parsing of syslog priority (GH #264)

...the code

* first looks for '<' and advances to the next character,
* it looks for a number between 0 and 9 and advances to the next
  character, (it finds 7)
* it looks for '>' and advances to the next character,
* it looks for a number between 0 and 9 and advances to the next
  character, (it finds the '2' of '2010')

=> result: prio is 72 instead of 7.

The code that checks if the character is '>' should be outside the loop
that checks if the character is a number. The attached patch moves this
check.
print-syslog.c
tests/syslog-v.out