]> The Tcpdump Group git mirrors - libpcap/blobdiff - optimize.c
Fix typpo.
[libpcap] / optimize.c
index 2360ad30629fc3d7fc0b2ffdf71ff1f64de2803e..d72cf7a4c6f19d7e920d14919b64630998e572b5 100644 (file)
@@ -60,14 +60,15 @@ int pcap_optimizer_debug;
  *
  * This is the same as the count of trailing zeroes in the word.
  */
-#if PCAP_IS_AT_LEAST_GNUC_VERSION(3, 4)
+#if PCAP_IS_AT_LEAST_GNUC_VERSION(3,4)
   /*
    * GCC 3.4 and later; we have __builtin_ctz().
    */
   #define lowest_set_bit(mask) __builtin_ctz(mask)
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif defined(_MSC_VER)
   /*
-   * Visual Studio 2005 and later; use _BitScanForward().
+   * Visual Studio; we support only 2005 and later, so use
+   * _BitScanForward().
    */
 #include <intrin.h>
 #pragma intrinsic(_BitScanForward)
@@ -2303,8 +2304,8 @@ install_bpf_program(pcap_t *p, struct bpf_program *fp)
        p->fcode.bf_len = fp->bf_len;
        p->fcode.bf_insns = (struct bpf_insn *)malloc(prog_size);
        if (p->fcode.bf_insns == NULL) {
-               pcap_snprintf(p->errbuf, sizeof(p->errbuf),
-                        "malloc: %s", pcap_strerror(errno));
+               pcap_fmt_errmsg_for_errno(p->errbuf, sizeof(p->errbuf),
+                   errno, "malloc");
                return (-1);
        }
        memcpy(p->fcode.bf_insns, fp->bf_insns, prog_size);