aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-null.c
diff options
context:
space:
mode:
authoritojun <itojun>2000-04-27 09:11:11 +0000
committeritojun <itojun>2000-04-27 09:11:11 +0000
commit20d9e08cde232247531358fd448ad845c89c7a16 (patch)
treeae51489e2f967ec34cc9cba84fc74e78b44a1104 /pcap-null.c
parent14b709dd48cc512bd2c8f0b8ddb57c2ac1fbfc9e (diff)
do not use sprintf(). always use snprintf().
from NetBSD/OpenBSD src/lib/libpcap. use freeifaddrs() if exists.
Diffstat (limited to 'pcap-null.c')
-rw-r--r--pcap-null.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pcap-null.c b/pcap-null.c
index cbc818b..963088f 100644
--- a/pcap-null.c
+++ b/pcap-null.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-null.c,v 1.7 1999-10-07 23:46:40 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-null.c,v 1.8 2000-04-27 09:11:13 itojun Exp $ (LBL)";
#endif
#include <sys/param.h> /* optionally get BSD define */
@@ -40,7 +40,7 @@ int
pcap_stats(pcap_t *p, struct pcap_stat *ps)
{
- (void)sprintf(p->errbuf, "pcap_stats: %s", nosup);
+ (void)snprintf(p->errbuf, sizeof(p->errbuf), "pcap_stats: %s", nosup);
return (-1);
}
@@ -48,7 +48,7 @@ int
pcap_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
{
- (void)sprintf(p->errbuf, "pcap_read: %s", nosup);
+ (void)snprintf(p->errbuf, sizeof(p->errbuf), "pcap_read: %s", nosup);
return (-1);
}
@@ -65,7 +65,8 @@ pcap_setfilter(pcap_t *p, struct bpf_program *fp)
{
if (p->sf.rfile == NULL) {
- (void)sprintf(p->errbuf, "pcap_setfilter: %s", nosup);
+ (void)snprintf(p->errbuf, sizeof(p->errbuf),
+ "pcap_setfilter: %s", nosup);
return (-1);
}
p->fcode = *fp;