summaryrefslogtreecommitdiffstats
path: root/usr.bin/printf
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2001-12-03 21:27:45 +0000
committerdwmalone <dwmalone@FreeBSD.org>2001-12-03 21:27:45 +0000
commit71a3cce2f6884be6778c740c9bd96fa224f849a0 (patch)
treef249bea7b83cc2809cfd62d4327291486ab3ac0f /usr.bin/printf
parentd2c37ac50bb64d6383c3396af34d7c9209611737 (diff)
downloadFreeBSD-src-71a3cce2f6884be6778c740c9bd96fa224f849a0.zip
FreeBSD-src-71a3cce2f6884be6778c740c9bd96fa224f849a0.tar.gz
Warns cleanups.
Diffstat (limited to 'usr.bin/printf')
-rw-r--r--usr.bin/printf/Makefile2
-rw-r--r--usr.bin/printf/printf.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/printf/Makefile b/usr.bin/printf/Makefile
index 52b20f4..1e57f83 100644
--- a/usr.bin/printf/Makefile
+++ b/usr.bin/printf/Makefile
@@ -1,5 +1,7 @@
+# $FreeBSD$
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= printf
+WARNS?= 2
.include <bsd.prog.mk>
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 897a063..37b18f1 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -94,7 +94,7 @@ static int getchr __P((void));
static double getdouble __P((void));
static int getint __P((int *));
static int getquad __P((quad_t *));
-static char *getstr __P((void));
+static const char *getstr __P((void));
static char *mklong __P((char *, int));
static void usage __P((void));
@@ -109,7 +109,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- static char *skip1, *skip2;
+ static const char *skip1, *skip2;
int ch, end, fieldwidth, precision;
char convch, nextch, *format, *fmt, *start;
@@ -217,7 +217,7 @@ next: for (start = fmt;; ++fmt) {
break;
}
case 's': {
- char *p;
+ const char *p;
p = getstr();
PF(start, p);
@@ -349,7 +349,7 @@ getchr()
return ((int)**gargv++);
}
-static char *
+static const char *
getstr()
{
if (!*gargv)
@@ -357,7 +357,7 @@ getstr()
return (*gargv++);
}
-static char *Number = "+-.0123456789";
+static const char *Number = "+-.0123456789";
static int
getint(ip)
int *ip;
OpenPOWER on IntegriCloud