1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-01 10:59:55 +00:00

- Fix compilation errors with libpcap installed from ports and warnings

with clang

PR:		ports/156968
Submitted by:	Marcin Cieslak <saper@saper.info> (maintainer)
This commit is contained in:
Frederic Culot 2011-05-12 07:38:34 +00:00
parent 2ac27a65bf
commit 6d02f1e239
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273993
5 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- alarm.c.orig 2011-05-12 02:48:08.000000000 +0200
+++ alarm.c 2011-05-12 02:48:40.000000000 +0200
@@ -93,7 +93,7 @@
timestamp[length] = ' ';
#ifdef HAVE_SYSLOG_H
if(syslog_flag)
- syslog(LOG_NOTICE, timestamp);
+ syslog(LOG_NOTICE, "%s", timestamp);
else
#endif
fwrite(timestamp, length+1, sizeof(char), stdout);
@@ -105,7 +105,7 @@
int len = strlen(message)+100;
s = malloc(len);/*estimation*/
vsnprintf(s,len,message, ap);
- syslog(LOG_NOTICE, s);
+ syslog(LOG_NOTICE, "%s", s);
free(s);
}
else

View File

@ -0,0 +1,11 @@
--- config_gram.y.orig 2011-05-12 02:54:26.000000000 +0200
+++ config_gram.y 2011-05-12 02:55:18.000000000 +0200
@@ -106,7 +106,7 @@
SPIT("Setting Group: %s\n", Spread_group); }
| W_LOG W_EQUALS W_STRING
| W_CONTROL W_EQUALS W_STRING
- { snprintf(control_socket, MAXPATHLEN, $3.string); }
+ { snprintf(control_socket, MAXPATHLEN, "%s", $3.string); }
| W_MATURE W_EQUALS W_TIMEINTERVAL
{ Maturity_timeout.sec = $3.tv.tv_sec;
Maturity_timeout.usec = 0;

View File

@ -0,0 +1,11 @@
--- configuration.c.orig 2011-05-12 02:55:52.000000000 +0200
+++ configuration.c 2011-05-12 02:56:03.000000000 +0200
@@ -43,7 +43,7 @@
char my_local_host_name[255];
static const size_t my_local_host_name_len=255;
struct hostent *hent;
- int i, full;
+ int full;
Num_prefer = 0;
if (File_name && File_name[0] && (NULL != (fp = fopen(File_name,"r"))) )

View File

@ -0,0 +1,28 @@
--- defines.h.orig 2005-03-30 21:56:58.000000000 +0200
+++ defines.h 2011-05-12 02:51:55.000000000 +0200
@@ -13,6 +13,9 @@
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -59,12 +62,12 @@
#ifdef HAVE_NET_ROUTE_H
#include <net/route.h>
#endif
-#ifdef HAVE_PCAP_H
-#include <pcap.h>
-#endif
#ifdef HAVE_NET_BPF_H
#include <net/bpf.h>
#endif
+#ifdef HAVE_PCAP_H
+#include <pcap.h>
+#endif
#ifdef HAVE_NET_ETHERNET_H
#include <net/ethernet.h>
#endif

View File

@ -0,0 +1,20 @@
--- wackamole.c.orig 2011-05-12 02:43:02.000000000 +0200
+++ wackamole.c 2011-05-12 02:46:20.000000000 +0200
@@ -911,7 +911,7 @@
wack_alarm(PRINT, "%d %s", __LINE__, if_error());
else {
char buffer[16];
- snprintf(buffer, 16, inet_ntoa(iface.ipaddr));
+ snprintf(buffer, 16, "%s", inet_ntoa(iface.ipaddr));
wack_alarm(PRINT, " UP: %s:%s/%s",
iface.ifname,buffer,inet_ntoa(iface.netmask));
}
@@ -954,7 +954,7 @@
}
} else {
char buffer[16];
- snprintf(buffer, 16, inet_ntoa(idown.ipaddr));
+ snprintf(buffer, 16, "%s", inet_ntoa(idown.ipaddr));
wack_alarm(PRINT, "DOWN: %s:%s/%s",
idown.ifname,buffer,inet_ntoa(idown.netmask));
}