Module Name: src
Committed By: lukem
Date: Mon Apr 13 07:06:53 UTC 2009
Modified Files:
src/usr.bin/rs: rs.c
Log Message:
fix -Wcast-qual issues
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/rs/rs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/rs/rs.c
diff -u src/usr.bin/rs/rs.c:1.12 src/usr.bin/rs/rs.c:1.13
--- src/usr.bin/rs/rs.c:1.12 Mon Jul 21 14:19:25 2008
+++ src/usr.bin/rs/rs.c Mon Apr 13 07:06:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: rs.c,v 1.12 2008/07/21 14:19:25 lukem Exp $ */
+/* $NetBSD: rs.c,v 1.13 2009/04/13 07:06:53 lukem Exp $ */
/*-
* Copyright (c) 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)rs.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: rs.c,v 1.12 2008/07/21 14:19:25 lukem Exp $");
+__RCSID("$NetBSD: rs.c,v 1.13 2009/04/13 07:06:53 lukem Exp $");
#endif
#endif /* not lint */
@@ -93,7 +93,7 @@
char isep = ' ', osep = ' ';
int owidth = 80, gutter = 2;
-void usage __P((char *, ...))
+void usage __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
void getargs __P((int, char *[]));
void getfile __P((void));
@@ -130,6 +130,7 @@
void
getfile()
{
+ char empty[1] = { '\0' };
char *p;
char *endp;
char **ep = 0;
@@ -170,7 +171,7 @@
if (*p == isep && multisep)
continue; /* eat up column separators */
if (*p == isep) /* must be an empty column */
- *ep = "";
+ *ep = empty;
else /* store column entry */
*ep = p;
while (p < endp && *p != isep)
@@ -184,7 +185,7 @@
if (nullpad) { /* pad missing entries */
padto = elem + irows * icols;
while (ep < padto) {
- *ep = "";
+ *ep = empty;
INCR(ep);
}
}
@@ -239,7 +240,7 @@
}
void
-usage(char *msg, ...)
+usage(const char *msg, ...)
{
va_list ap;