]> The Tcpdump Group git mirrors - libpcap/blobdiff - gencode.c
Add a routine to format error messages with an errno-based message at the end.
[libpcap] / gencode.c
index 69dbaa396be30d808ec67c9db9f2cabb25b851ac..b7a3b4e93c38875da4745a756574f293d522c63b 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -734,7 +734,8 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
        }
 
        if (pcap_lex_init(&scanner) != 0)
-               bpf_error(&cstate, "can't initialize scanner: %s", pcap_strerror(errno));
+               pcap_fmt_errmsg_for_errno(p->errbuf, PCAP_ERRBUF_SIZE,
+                   errno, "can't initialize scanner");
        in_buffer = pcap__scan_string(xbuf ? xbuf : "", scanner);
 
        /*