Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Jun 2001 23:40:44 -0700
From:      Dima Dorfman <dima@unixfreak.org>
To:        audit@freebsd.org
Subject:   cut(1) WARNS patch
Message-ID:  <20010602064044.AD9263E32@bazooka.unixfreak.org>

next in thread | raw e-mail | index | archive | help
Attached is a patch which silences the remaining warnings for cut(1).
It's rather trivial, but I'd like someone to confirm that the first
change is correct.  'stop' is a size_t, which is long on the Alpha but
int on the i386.  The fix below to print it using %ld and cast it to
long seems to be logically correct (and it works).

Thanks in advance,

					Dima Dorfman
					dima@unixfreak.org


Index: cut.c
===================================================================
RCS file: /stl/src/FreeBSD/src/usr.bin/cut/cut.c,v
retrieving revision 1.13
diff -u -r1.13 cut.c
--- cut.c	2001/04/25 05:42:53	1.13
+++ cut.c	2001/06/02 06:37:39
@@ -172,8 +172,8 @@
 		if (!stop || !start)
 			errx(1, "[-cf] list: values may not include zero");
 		if (stop > _POSIX2_LINE_MAX)
-			errx(1, "[-cf] list: %d too large (max %d)",
-			    stop, _POSIX2_LINE_MAX);
+			errx(1, "[-cf] list: %ld too large (max %d)",
+			    (long)stop, _POSIX2_LINE_MAX);
 		if (maxval < stop)
 			maxval = stop;
 		for (pos = positions + start; start++ <= stop; *pos++ = 1);
@@ -223,7 +223,7 @@
 void
 f_cut(fp, fname)
 	FILE *fp;
-	const char *fname;
+	const char *fname __unused;
 {
 	int ch, field, isdelim;
 	char *pos, *p, sep;

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?20010602064044.AD9263E32>