From be9efd564109424704e51418a70c2203ca26612b Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Mon, 4 Feb 2002 01:28:45 +0000 Subject: [PATCH] Mark report() as printflike and fix resulting warnings, including one bug (get_errmsg -> get_errmsg()) --- libexec/bootpd/bootpd.c | 2 +- libexec/bootpd/dovend.c | 2 +- libexec/bootpd/getether.c | 2 +- libexec/bootpd/report.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c index 54de708f6309..03fce45cf5ff 100644 --- a/libexec/bootpd/bootpd.c +++ b/libexec/bootpd/bootpd.c @@ -1239,7 +1239,7 @@ dovend_rfc1048(bp, hp, bootsize) int bytesleft, len; byte *vp; - static char noroom[] = "%s: No room for \"%s\" option"; + static const char noroom[] = "%s: No room for \"%s\" option"; vp = bp->bp_vend; diff --git a/libexec/bootpd/dovend.c b/libexec/bootpd/dovend.c index 9c8457b74908..279d59c88fce 100644 --- a/libexec/bootpd/dovend.c +++ b/libexec/bootpd/dovend.c @@ -59,7 +59,7 @@ dovend_rfc1497(hp, buf, len) int bytesleft = len; byte *vp = buf; - static char noroom[] = "%s: No room for \"%s\" option"; + static const char noroom[] = "%s: No room for \"%s\" option"; #define NEED(LEN, MSG) do \ if (bytesleft < (LEN)) { \ report(LOG_NOTICE, noroom, \ diff --git a/libexec/bootpd/getether.c b/libexec/bootpd/getether.c index da582e98ebfe..e894e53dc7e8 100644 --- a/libexec/bootpd/getether.c +++ b/libexec/bootpd/getether.c @@ -139,7 +139,7 @@ getether(ifname, eap) ifc.ifc_buf = (caddr_t) ibuf; if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 || ifc.ifc_len < sizeof(struct ifreq)) { - report(LOG_ERR, "getether: SIOCGIFCONF: %s", get_errmsg); + report(LOG_ERR, "getether: SIOCGIFCONF: %s", get_errmsg()); goto out; } /* Search interface configuration list for link layer address. */ diff --git a/libexec/bootpd/report.h b/libexec/bootpd/report.h index 6b96ac61c43d..2b6f622c645c 100644 --- a/libexec/bootpd/report.h +++ b/libexec/bootpd/report.h @@ -8,7 +8,7 @@ #endif extern void report_init P((int nolog)); -extern void report P((int, const char *, ...)); +extern void report P((int, const char *, ...)) __printflike(2, 3); extern const char *get_errmsg P((void)); #undef P