summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2001-07-15 00:09:46 +0000
committergad <gad@FreeBSD.org>2001-07-15 00:09:46 +0000
commit75f5203b04d78ac555161bc219da58cbfeffefbd (patch)
tree72f0a137b622cd6dc694bb199a12a08fd1b19169 /usr.sbin/lpr/common_source
parentc37f9bf14e59460fb949e607da4073e223e0972d (diff)
downloadFreeBSD-src-75f5203b04d78ac555161bc219da58cbfeffefbd.zip
FreeBSD-src-75f5203b04d78ac555161bc219da58cbfeffefbd.tar.gz
Fix most of the warnings generated by compiling lpr with -Wnon-const-format,
often by just telling gcc that some internal routine is "__printflike" (work done by Kris Kennaway <kris@FreeBSD.org>). Also fix the new warnings which show up once gcc starts checking the "printf-like parameters" passed to those routines. MFC after: 1 week
Diffstat (limited to 'usr.sbin/lpr/common_source')
-rw-r--r--usr.sbin/lpr/common_source/displayq.c6
-rw-r--r--usr.sbin/lpr/common_source/lp.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index 7eef91e..c4233c5 100644
--- a/usr.sbin/lpr/common_source/displayq.c
+++ b/usr.sbin/lpr/common_source/displayq.c
@@ -270,10 +270,10 @@ warn(const struct printer *pp)
void
header(void)
{
- printf(head0);
+ printf("%s", head0);
col = strlen(head0)+1;
blankfill(SIZCOL);
- printf(head1);
+ printf("%s", head1);
}
void
@@ -454,7 +454,7 @@ dump(const char *nfile, const char *datafile, int copies)
remetc = strlen(etctmpl);
etc[0] = '\0';
strncat(etc, etctmpl, remetc);
- printf(etc);
+ printf("%s", etc);
col += remetc;
rem -= remetc;
/* room for the last segment of this filename? */
diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h
index 9ca0612..0adf0fd 100644
--- a/usr.sbin/lpr/common_source/lp.h
+++ b/usr.sbin/lpr/common_source/lp.h
@@ -242,7 +242,8 @@ void closeallfds(int _start);
void delay(int _millisec);
void displayq(struct printer *_pp, int _format);
void dump(const char *_nfile, const char *_datafile, int _copies);
-void fatal(const struct printer *_pp, const char *_msg, ...);
+void fatal(const struct printer *_pp, const char *_msg, ...)
+ __printflike(2, 3);
int firstprinter(struct printer *_pp, int *_error);
void free_printer(struct printer *_pp);
void free_request(struct request *_rp);
OpenPOWER on IntegriCloud