aboutsummaryrefslogtreecommitdiff
path: root/pcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcap.c')
-rw-r--r--pcap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pcap.c b/pcap.c
index 29459de9..70c0f063 100644
--- a/pcap.c
+++ b/pcap.c
@@ -1922,12 +1922,11 @@ pcap_do_addexit(pcap_t *p)
* "pcap_close_all()" called when we exit.
*/
if (!did_atexit) {
- if (atexit(pcap_close_all) == -1) {
+ if (atexit(pcap_close_all) != 0) {
/*
* "atexit()" failed; let our caller know.
*/
- strncpy(p->errbuf, "atexit failed",
- PCAP_ERRBUF_SIZE);
+ strlcpy(p->errbuf, "atexit failed", PCAP_ERRBUF_SIZE);
return (0);
}
did_atexit = 1;