Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2001 01:44:26 -0400 (EDT)
From:      Mike Barcroft <mike@q9media.com>
To:        audit@FreeBSD.org
Subject:   src/usr.sbin/spray patch
Message-ID:  <200106250544.f5P5iQR91718@coffee.q9media.com>

next in thread | raw e-mail | index | archive | help
I would appreciate it if someone would review and commit the patch at
the end of this message.  Also available at:
http://testbed.q9media.net/freebsd/spray.20010625.patch


Best regards,
Mike Barcroft

-----------------------------------------------------------------------

spray.20010625.patch

o Add missing header
o Make some ints unsigned to avoid compiler warnings.
o Since the prototypes aren't K&R compatible anyway,
  convert them to ANSI C.
o Set WARNS?=2


Index: spray/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.sbin/spray/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- spray/Makefile	2001/03/26 14:41:59	1.7
+++ spray/Makefile	2001/06/25 05:24:11
@@ -1,6 +1,7 @@
 # $FreeBSD: src/usr.sbin/spray/Makefile,v 1.7 2001/03/26 14:41:59 ru Exp $
 
 PROG=	spray
+WARNS?=	2
 MAN=	spray.8
 DPADD=	${LIBRPCSVC}
 LDADD=	-lrpcsvc
Index: spray/spray.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/spray/spray.c,v
retrieving revision 1.6
diff -u -r1.6 spray.c
--- spray/spray.c	2000/05/28 15:05:15	1.6
+++ spray/spray.c	2001/06/25 05:24:12
@@ -33,6 +33,7 @@
   "$FreeBSD: src/usr.sbin/spray/spray.c,v 1.6 2000/05/28 15:05:15 charnier Exp $";
 #endif /* not lint */
 
+#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -44,8 +45,8 @@
 #define SPRAYOVERHEAD	86
 #endif
 
-static void usage ();
-void print_xferstats ();
+static void usage(void);
+static void print_xferstats(int, int, double);
 
 /* spray buffer */
 char spray_buffer[SPRAYMAX];
@@ -64,8 +65,8 @@
 	sprayarr	host_array;
 	CLIENT *cl;
 	int c;
-	int i;
-	int count = 0;
+	u_int i;
+	u_int count = 0;
 	int delay = 0;
 	int length = 0;
 	double xmit_time;			/* time to receive data */
@@ -186,11 +187,8 @@
 }
 
 
-void
-print_xferstats(packets, packetlen, xfertime)
-	int packets;
-	int packetlen;
-	double xfertime;
+static void
+print_xferstats(int packets, int packetlen, double xfertime)
 {
 	int datalen;
 	double pps;		/* packets per second */
@@ -212,7 +210,7 @@
 
 
 static void
-usage ()
+usage(void)
 {
 	fprintf(stderr,
 		"usage: spray [-c count] [-l length] [-d delay] host\n");

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106250544.f5P5iQR91718>