Closed PeiweiHu closed 2 years ago
Ugh, it's not the first time their docs are wrong.
Thanks.
I've also opened a pull request to fix their docs.
Ugh, it's not the first time their docs are wrong.
Thanks.
I've also opened a pull request to fix their docs.
ok, I opened an issue too. https://github.com/the-tcpdump-group/libpcap/issues/1059. You can quote in your PR. :-)
Yup, found it and already did.
In fact, it returns >0 on success
1 > 0; under what circumstances have you found that it returns a value > 1?
Ugh, it's not the first time their docs are wrong.
Thanks.
I've also opened a pull request to fix their docs.
I forgot that only cnt=1 is passed to pcap_offline_read. Sorry for bothering you. orz
Although the document of libpcap says pcap_next_ex returns 1 on success. In fact, it returns >0 on success. So it's better to change the return value check to >0.
See: