warns fixes for bin/date

Giorgos Keramidas <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
The type of a variable passed to getsockopt and recvfrom in
src/bin/date/netdate.c is `int'.  Changing it to `socklen_t'
fixes the only warnings that this utility has when compiling
with WARNS=6.

How does this look?

%%%
Index: Makefile
===================================================================
RCS file: /home/ncvs/src/bin/date/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	4 Feb 2002 02:49:18 -0000	1.10
+++ Makefile	9 Jun 2002 01:34:21 -0000
@@ -3,7 +3,7 @@
 
 PROG=	date
 SRCS=	date.c netdate.c vary.c
-WARNS=	0
+WARNS=	6
 WFORMAT=0
 DPADD=	${LIBUTIL}
 LDADD=	-lutil
Index: netdate.c
===================================================================
RCS file: /home/ncvs/src/bin/date/netdate.c,v
retrieving revision 1.14
diff -u -r1.14 netdate.c
--- netdate.c	22 Feb 2002 20:47:20 -0000	1.14
+++ netdate.c	9 Jun 2002 01:34:16 -0000
@@ -76,7 +76,8 @@
 	struct sockaddr_in lsin, dest, from;
 	fd_set ready;
 	long waittime;
-	int s, length, port, timed_ack, found, lerr;
+	int s, port, timed_ack, found, lerr;
+	socklen_t length;
 	char hostname[MAXHOSTNAMELEN];
 
 	if ((sp = getservbyname("timed", "udp")) == NULL) {
%%%


To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.