aboutsummaryrefslogtreecommitdiff
path: root/bpf_image.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-11-03 15:59:38 -0800
committerGuy Harris <guy@alum.mit.edu>2015-11-03 15:59:38 -0800
commit735f1f9d3318693f0096be4198d34e9ac0985777 (patch)
tree3c2c26fc4df90474fad17f135dcec92748e77406 /bpf_image.c
parent17e43dfad4f2923adc1a6c396b4e8e30a6a1dbb9 (diff)
Use pcap_snprintf() instead of snprintf().
On UN*Xes with snprintf(), we just #define pcap_snprintf to snprintf. On UN*Xes without snprintf(), we provide our own, but call it pcap_snprintf(). On Windows, we have a routine that wraps _snprintf(), with C99 semantics (ensuring null termination if the string won't fit), called pcap_snprintf(), and use that.
Diffstat (limited to 'bpf_image.c')
-rw-r--r--bpf_image.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bpf_image.c b/bpf_image.c
index a7beb1f4..01ec536d 100644
--- a/bpf_image.c
+++ b/bpf_image.c
@@ -306,13 +306,13 @@ bpf_image(p, n)
fmt = "";
break;
}
- (void)snprintf(operand, sizeof operand, fmt, v);
+ (void)pcap_snprintf(operand, sizeof operand, fmt, v);
if (BPF_CLASS(p->code) == BPF_JMP && BPF_OP(p->code) != BPF_JA) {
- (void)snprintf(image, sizeof image,
+ (void)pcap_snprintf(image, sizeof image,
"(%03d) %-8s %-16s jt %d\tjf %d",
n, op, operand, n + 1 + p->jt, n + 1 + p->jf);
} else {
- (void)snprintf(image, sizeof image,
+ (void)pcap_snprintf(image, sizeof image,
"(%03d) %-8s %s",
n, op, operand);
}