From d8302e2d73ac3fde74ec6f157dcba7ddbd24fed2 Mon Sep 17 00:00:00 2001 From: is Date: Wed, 11 Oct 2000 20:23:46 +0000 Subject: [PATCH] More format string cleanups by sommerfeld. --- usr.sbin/amd/hlfsd/hlfsd.c | 4 ++-- usr.sbin/amd/include/am_utils.h | 6 ++--- usr.sbin/amd/libamu/mount_fs.c | 10 +++------ usr.sbin/amd/libamu/xutil.c | 19 +++++++++------- usr.sbin/arp/arp.c | 12 ++++------ usr.sbin/bind/Makefile.inc | 4 ++-- usr.sbin/bootp/bootpd/bootpd.c | 4 ++-- usr.sbin/bootp/bootptest/getether.c | 6 ++--- usr.sbin/bootp/common/dovend.c | 6 ++--- usr.sbin/bootp/common/hwaddr.c | 6 ++--- usr.sbin/bootp/common/report.c | 8 +++---- usr.sbin/bootp/common/report.h | 5 +++-- usr.sbin/config/config.h | 17 +++++++++----- usr.sbin/config/util.c | 11 +++++---- usr.sbin/dhcp/client/dhclient.c | 10 ++++----- usr.sbin/dhcp/common/parse.c | 7 ++++-- usr.sbin/dhcp/common/print.c | 12 +++++----- usr.sbin/dhcp/minires/res_update.c | 5 +++-- usr.sbin/dhcp/omapip/errwarn.c | 14 +++++++----- usr.sbin/dhcp/relay/dhcrelay.c | 10 ++++----- usr.sbin/dhcp/server/dhcpd.c | 10 ++++----- usr.sbin/gspa/gspa/gsp_ass.h | 8 ++++--- usr.sbin/gspa/gspa/gspa.c | 6 ++--- usr.sbin/lpr/common_source/displayq.c | 8 +++---- usr.sbin/lpr/common_source/lp.h | 5 +++-- usr.sbin/lpr/lpd/printjob.c | 7 +++--- usr.sbin/lpr/lpd/recvjob.c | 7 +++--- usr.sbin/lpr/lpr/lpr.c | 9 ++++---- usr.sbin/map-mbone/mapper.c | 11 ++++++--- usr.sbin/mrinfo/mrinfo.c | 11 ++++++--- usr.sbin/mrouted/cfparse.y | 8 ++++--- usr.sbin/mrouted/defs.h | 5 +++-- usr.sbin/mrouted/main.c | 16 +++++++++----- usr.sbin/mtrace/mtrace.c | 11 ++++++--- usr.sbin/mtree/create.c | 9 ++++---- usr.sbin/mtree/extern.h | 5 +++-- usr.sbin/pim6dd/debug.c | 4 ++-- usr.sbin/pim6sd/debug.h | 5 +++-- usr.sbin/pkg_install/add/perform.c | 14 +++++------- usr.sbin/pkg_install/lib/file.c | 8 +++---- usr.sbin/pkg_install/lib/lib.h | 5 +++-- usr.sbin/pppd/pppd/options.c | 6 ++--- usr.sbin/pstat/pstat.c | 6 ++--- usr.sbin/rarpd/rarpd.c | 10 +++++---- usr.sbin/rbootd/utils.c | 16 +++++++------- usr.sbin/rpc.lockd/lock_proc.c | 6 ++--- usr.sbin/rwhod/rwhod.c | 4 ++-- usr.sbin/sesd/srcs/sesd.c | 4 ++-- usr.sbin/sup/source/log.c | 12 +++++----- usr.sbin/sup/source/supextern.h | 32 ++++++++++++++++++--------- usr.sbin/tcpdchk/Makefile | 4 +--- usr.sbin/tcpdchk/percent_m.h | 5 +++-- usr.sbin/tcpdump/print-bootp.c | 6 ++--- usr.sbin/user/user.c | 9 +++++--- usr.sbin/ypbind/ypbind.c | 7 +++--- 55 files changed, 266 insertions(+), 209 deletions(-) diff --git a/usr.sbin/amd/hlfsd/hlfsd.c b/usr.sbin/amd/hlfsd/hlfsd.c index 22acc3d4ad76..7b130367b0e9 100644 --- a/usr.sbin/amd/hlfsd/hlfsd.c +++ b/usr.sbin/amd/hlfsd/hlfsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: hlfsd.c,v 1.8 1999/09/04 22:38:18 christos Exp $ */ +/* $NetBSD: hlfsd.c,v 1.9 2000/10/11 20:23:46 is Exp $ */ /* * Copyright (c) 1997-1999 Erez Zadok @@ -949,7 +949,7 @@ fatal(char *mess) #endif } } - plog(XLOG_FATAL, mess); + plog(XLOG_FATAL, "%s", mess); hlfsd_going_down(1); } diff --git a/usr.sbin/amd/include/am_utils.h b/usr.sbin/amd/include/am_utils.h index f848d2613347..370083bb531f 100644 --- a/usr.sbin/amd/include/am_utils.h +++ b/usr.sbin/amd/include/am_utils.h @@ -1,4 +1,4 @@ -/* $NetBSD: am_utils.h,v 1.8 1999/09/04 22:38:19 christos Exp $ */ +/* $NetBSD: am_utils.h,v 1.9 2000/10/11 20:23:47 is Exp $ */ /* * Copyright (c) 1997-1999 Erez Zadok @@ -645,7 +645,7 @@ extern void nfs_program_2(struct svc_req *rqstp, SVCXPRT *transp); extern void normalize_slash(char *); extern void ops_showamfstypes(char *buf); extern void ops_showfstypes(char *outbuf); -extern void plog(int, char *,...) +extern void plog(int, const char *,...) __attribute__ ((__format__ (__printf__, 2, 3))); extern void rem_que(qelem *); extern void reschedule_timeout_mp(void); @@ -967,7 +967,7 @@ extern void print_nfs_args(const nfs_args_t *nap, u_long nfs_version); extern int debug_flags; /* Debug options */ extern int debug_option (char *opt); extern struct opt_tab dbg_opt[]; -extern void dplog(char *fmt, ...) +extern void dplog(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); /**************************************************************************/ diff --git a/usr.sbin/amd/libamu/mount_fs.c b/usr.sbin/amd/libamu/mount_fs.c index 3d7b3cd10053..698e06f60b10 100644 --- a/usr.sbin/amd/libamu/mount_fs.c +++ b/usr.sbin/amd/libamu/mount_fs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mount_fs.c,v 1.1.1.7 1999/09/04 22:24:56 christos Exp $ */ +/* $NetBSD: mount_fs.c,v 1.2 2000/10/11 20:23:48 is Exp $ */ /* * Copyright (c) 1997-1999 Erez Zadok @@ -176,14 +176,10 @@ mount_fs(mntent_t *mnt, int flags, caddr_t mnt_data, int retry, MTYPE_TYPE type, char optsbuf[48]; # endif /* defined(MNTTAB_OPT_DEV) || (defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS)) || defined(MNTTAB_OPT_PROTO) */ #endif /* MOUNT_TABLE_ON_FILE */ -#ifdef DEBUG - char buf[80]; /* buffer for sprintf */ -#endif /* DEBUG */ #ifdef DEBUG - sprintf(buf, "%s%s%s", - "%s fstype ", MTYPE_PRINTF_TYPE, " (%s) flags %#x (%s)"); - dlog(buf, mnt->mnt_dir, type, mnt->mnt_type, flags, mnt->mnt_opts); + dlog("%s fstype " MTYPE_PRINTF_TYPE " (%s) flags %#x (%s)", + mnt->mnt_dir, type, mnt->mnt_type, flags, mnt->mnt_opts); #endif /* DEBUG */ again: diff --git a/usr.sbin/amd/libamu/xutil.c b/usr.sbin/amd/libamu/xutil.c index 75d71a5acec7..60262941a991 100644 --- a/usr.sbin/amd/libamu/xutil.c +++ b/usr.sbin/amd/libamu/xutil.c @@ -1,4 +1,4 @@ -/* $NetBSD: xutil.c,v 1.6 2000/07/04 20:27:35 matt Exp $ */ +/* $NetBSD: xutil.c,v 1.7 2000/10/11 20:23:48 is Exp $ */ /* * Copyright (c) 1997-1999 Erez Zadok @@ -82,7 +82,8 @@ static int orig_mem_bytes; #endif /* DEBUG_MEM */ /* forward definitions */ -static void real_plog(int lvl, char *fmt, va_list vargs); +static void real_plog(int lvl, const char *fmt, va_list vargs) + __attribute__((__format__(__printf__, 2, 0))); #ifdef DEBUG /* @@ -283,12 +284,13 @@ checkup_mem(void) * 'e' never gets longer than maxlen characters. */ static void -expand_error(char *f, char *e, int maxlen) +expand_error(const char *f, char *e, int maxlen) { #ifndef HAVE_STRERROR extern int sys_nerr; #endif - char *p, *q; + const char *p; + char *q; int error = errno; int len = 0; @@ -380,7 +382,7 @@ debug_option(char *opt) void -dplog(char *fmt, ...) +dplog(const char *fmt, ...) { va_list ap; @@ -395,7 +397,7 @@ dplog(char *fmt, ...) void -plog(int lvl, char *fmt, ...) +plog(int lvl, const char *fmt, ...) { va_list ap; @@ -409,7 +411,7 @@ plog(int lvl, char *fmt, ...) static void -real_plog(int lvl, char *fmt, va_list vargs) +real_plog(int lvl, const char *fmt, va_list vargs) { char msg[1024]; char efmt[1024]; @@ -432,7 +434,8 @@ real_plog(int lvl, char *fmt, va_list vargs) * to 1023 (including the '\0'). * */ - vsnprintf(ptr, 1023, efmt, vargs); + fmt = efmt; + vsnprintf(ptr, 1023, fmt, vargs); msg[1022] = '\0'; /* null terminate, to be sure */ ptr += strlen(ptr); diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 4e5ebaf0f44f..b37d068612be 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -1,4 +1,4 @@ -/* $NetBSD: arp.c,v 1.25 2000/09/28 01:11:31 erh Exp $ */ +/* $NetBSD: arp.c,v 1.26 2000/10/11 20:23:48 is Exp $ */ /* * Copyright (c) 1984, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1984, 1993\n\ #if 0 static char sccsid[] = "@(#)arp.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: arp.c,v 1.25 2000/09/28 01:11:31 erh Exp $"); +__RCSID("$NetBSD: arp.c,v 1.26 2000/10/11 20:23:48 is Exp $"); #endif #endif /* not lint */ @@ -454,18 +454,14 @@ sdl_print(sdl) { int i; u_int8_t *p; - const char *hexfmt = "%x"; - - if (sdl->sdl_type == IFT_ETHER || sdl->sdl_type == IFT_FDDI) - hexfmt = "%02x"; i = sdl->sdl_alen; p = LLADDR(sdl); - (void)printf(hexfmt, *p); + (void)printf("%02x", *p); while (--i > 0) { putchar(':'); - (void)printf(hexfmt, *++p); + (void)printf("%02x", *++p); } } diff --git a/usr.sbin/bind/Makefile.inc b/usr.sbin/bind/Makefile.inc index d6facdbef8ef..42a96812531a 100644 --- a/usr.sbin/bind/Makefile.inc +++ b/usr.sbin/bind/Makefile.inc @@ -1,7 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.6 2000/03/01 10:50:01 itojun Exp $ +# $NetBSD: Makefile.inc,v 1.7 2000/10/11 20:23:48 is Exp $ WARNS=0 - +WFORMAT=2 BIND_DIR= ${.CURDIR}/.. BIND_DIST_DIR= ${.CURDIR}/../../../dist/bind diff --git a/usr.sbin/bootp/bootpd/bootpd.c b/usr.sbin/bootp/bootpd/bootpd.c index f96f54a13995..598fae83aa6c 100644 --- a/usr.sbin/bootp/bootpd/bootpd.c +++ b/usr.sbin/bootp/bootpd/bootpd.c @@ -22,7 +22,7 @@ SOFTWARE. #include #ifndef lint -__RCSID("$NetBSD: bootpd.c,v 1.12 1999/01/31 19:12:27 briggs Exp $"); +__RCSID("$NetBSD: bootpd.c,v 1.13 2000/10/11 20:23:48 is Exp $"); #endif /* @@ -1242,7 +1242,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/usr.sbin/bootp/bootptest/getether.c b/usr.sbin/bootp/bootptest/getether.c index 5c1414a522a2..74a0be733735 100644 --- a/usr.sbin/bootp/bootptest/getether.c +++ b/usr.sbin/bootp/bootptest/getether.c @@ -1,8 +1,8 @@ -/* $NetBSD: getether.c,v 1.3 1998/03/14 04:39:54 lukem Exp $ */ +/* $NetBSD: getether.c,v 1.4 2000/10/11 20:23:49 is Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: getether.c,v 1.3 1998/03/14 04:39:54 lukem Exp $"); +__RCSID("$NetBSD: getether.c,v 1.4 2000/10/11 20:23:49 is Exp $"); #endif /* @@ -149,7 +149,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/usr.sbin/bootp/common/dovend.c b/usr.sbin/bootp/common/dovend.c index 29f58e9069c2..b8e0cf9bde99 100644 --- a/usr.sbin/bootp/common/dovend.c +++ b/usr.sbin/bootp/common/dovend.c @@ -1,8 +1,8 @@ -/* $NetBSD: dovend.c,v 1.3 1998/03/14 04:39:54 lukem Exp $ */ +/* $NetBSD: dovend.c,v 1.4 2000/10/11 20:23:49 is Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: dovend.c,v 1.3 1998/03/14 04:39:54 lukem Exp $"); +__RCSID("$NetBSD: dovend.c,v 1.4 2000/10/11 20:23:49 is Exp $"); #endif /* @@ -67,7 +67,7 @@ dovend_rfc1497(hp, buf, len) char *tmpstr; #endif - 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/usr.sbin/bootp/common/hwaddr.c b/usr.sbin/bootp/common/hwaddr.c index 5510a514a24a..3a1e6335f4d1 100644 --- a/usr.sbin/bootp/common/hwaddr.c +++ b/usr.sbin/bootp/common/hwaddr.c @@ -1,8 +1,8 @@ -/* $NetBSD: hwaddr.c,v 1.4 1998/03/14 04:39:54 lukem Exp $ */ +/* $NetBSD: hwaddr.c,v 1.5 2000/10/11 20:23:49 is Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: hwaddr.c,v 1.4 1998/03/14 04:39:54 lukem Exp $"); +__RCSID("$NetBSD: hwaddr.c,v 1.5 2000/10/11 20:23:49 is Exp $"); #endif /* @@ -144,7 +144,7 @@ setarp(s, ia, ha, len) sprintf(buf, "arp -d %s; arp -s %s %s temp", a, a, haddrtoa(ha, len)); if (debug > 2) - report(LOG_INFO, buf); + report(LOG_INFO, "%s", buf); status = system(buf); if (status) report(LOG_ERR, "arp failed, exit code=0x%x", status); diff --git a/usr.sbin/bootp/common/report.c b/usr.sbin/bootp/common/report.c index 555448e5efb0..3fb7a6f6fae7 100644 --- a/usr.sbin/bootp/common/report.c +++ b/usr.sbin/bootp/common/report.c @@ -1,8 +1,8 @@ -/* $NetBSD: report.c,v 1.4 1998/07/26 15:33:34 mycroft Exp $ */ +/* $NetBSD: report.c,v 1.5 2000/10/11 20:23:49 is Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: report.c,v 1.4 1998/07/26 15:33:34 mycroft Exp $"); +__RCSID("$NetBSD: report.c,v 1.5 2000/10/11 20:23:49 is Exp $"); #endif /* @@ -98,13 +98,13 @@ static int numlevels = sizeof(levelnames) / sizeof(levelnames[0]); */ #ifdef __STDC__ void -report(int priority, char *fmt,...) +report(int priority, const char *fmt,...) #else /*VARARGS2*/ void report(priority, fmt, va_alist) int priority; - char *fmt; + const char *fmt; va_dcl #endif { diff --git a/usr.sbin/bootp/common/report.h b/usr.sbin/bootp/common/report.h index 4b15da80d258..4fe7b9913a86 100644 --- a/usr.sbin/bootp/common/report.h +++ b/usr.sbin/bootp/common/report.h @@ -1,4 +1,4 @@ -/* $NetBSD: report.h,v 1.3 1998/07/26 15:33:34 mycroft Exp $ */ +/* $NetBSD: report.h,v 1.4 2000/10/11 20:23:49 is Exp $ */ /* report.h */ @@ -9,7 +9,8 @@ #endif extern void report_init P((int nolog)); -extern void report P((int, char *, ...)); +extern void report P((int, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); extern const char *get_errmsg P((void)); #undef P diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index 3cb4329f9d63..7e68f87130ff 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.50 2000/10/02 19:59:42 cgd Exp $ */ +/* $NetBSD: config.h,v 1.51 2000/10/11 20:23:49 is Exp $ */ /* * Copyright (c) 1992, 1993 @@ -80,7 +80,8 @@ (((x) & 0x000000ff) >> 0))) #define makedev(x,y) ((dev_t)((((x) << 8) & 0x000fff00) | \ (((y) << 12) & 0xfff00000) | \ - (((y) << 0) & 0x000000ff))) + (((y) << 0) & 0x000000ff))) +#define __attribute__(x) #endif /* MAKE_BOOTSTRAP */ #define ARRCHR '#' @@ -437,10 +438,14 @@ char *estrdup(const char *); void prefix_push(const char *); void prefix_pop(void); char *sourcepath(const char *); -void warn(const char *, ...); /* immediate warns */ -void error(const char *, ...); /* immediate errs */ -void xerror(const char *, int, const char *, ...); /* delayed errs */ -__dead void panic(const char *, ...); +void warn(const char *, ...) /* immediate warns */ + __attribute__((__format__(__printf__, 1, 2))); +void error(const char *, ...) /* immediate errs */ + __attribute__((__format__(__printf__, 1, 2))); +void xerror(const char *, int, const char *, ...) /* delayed errs */ + __attribute__((__format__(__printf__, 3, 4))); +__dead void panic(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); struct nvlist *newnv(const char *, const char *, void *, int, struct nvlist *); void nvfree(struct nvlist *); void nvfreel(struct nvlist *); diff --git a/usr.sbin/config/util.c b/usr.sbin/config/util.c index 87ea9155ddcb..2f0535978dd5 100644 --- a/usr.sbin/config/util.c +++ b/usr.sbin/config/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.13 2000/10/02 19:48:35 cgd Exp $ */ +/* $NetBSD: util.c,v 1.14 2000/10/11 20:23:50 is Exp $ */ /* * Copyright (c) 1992, 1993 @@ -53,10 +53,13 @@ #include "config.h" static void nomem(void); -static void vxerror(const char *, int, const char *, va_list); -static void vxwarn(const char *, int, const char *, va_list); +static void vxerror(const char *, int, const char *, va_list) + __attribute__((__format__(__printf__, 3, 0))); +static void vxwarn(const char *, int, const char *, va_list) + __attribute__((__format__(__printf__, 3, 0))); static void vxmsg(const char *fname, int line, const char *class, - const char *fmt, va_list); + const char *fmt, va_list) + __attribute__((__format__(__printf__, 4, 0))); /* * Malloc, with abort on error. diff --git a/usr.sbin/dhcp/client/dhclient.c b/usr.sbin/dhcp/client/dhclient.c index 79c99c9290fe..f105724becef 100644 --- a/usr.sbin/dhcp/client/dhclient.c +++ b/usr.sbin/dhcp/client/dhclient.c @@ -41,7 +41,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhclient.c,v 1.32 2000/09/04 23:19:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.33 2000/10/11 20:23:50 is Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -69,10 +69,10 @@ struct in_addr giaddr; assert (state_is == state_shouldbe). */ #define ASSERT_STATE(state_is, state_shouldbe) {} -static char copyright[] = "Copyright 1995-2000 Internet Software Consortium."; -static char arr [] = "All rights reserved."; -static char message [] = "Internet Software Consortium DHCP Client"; -static char url [] = "For info, please visit http://www.isc.org/products/DHCP"; +static const char copyright[] = "Copyright 1995-2000 Internet Software Consortium."; +static const char arr [] = "All rights reserved."; +static const char message [] = "Internet Software Consortium DHCP Client"; +static const char url [] = "For info, please visit http://www.isc.org/products/DHCP"; u_int16_t local_port; u_int16_t remote_port; diff --git a/usr.sbin/dhcp/common/parse.c b/usr.sbin/dhcp/common/parse.c index 0eff2b8d592d..3326e344f5af 100644 --- a/usr.sbin/dhcp/common/parse.c +++ b/usr.sbin/dhcp/common/parse.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.1.1.9 2000/09/04 23:10:15 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.2 2000/10/11 20:23:50 is Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -4082,7 +4082,10 @@ int parse_warn (struct parse *cfile, const char *fmt, ...) #endif va_start (list, fmt); - vsnprintf (mbuf, sizeof mbuf, fbuf, list); + + fmt = fbuf; + vsnprintf (mbuf, sizeof mbuf, fmt, list); + va_end (list); lix = 0; diff --git a/usr.sbin/dhcp/common/print.c b/usr.sbin/dhcp/common/print.c index aead37269eb0..c263937efb30 100644 --- a/usr.sbin/dhcp/common/print.c +++ b/usr.sbin/dhcp/common/print.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: print.c,v 1.1.1.7 2000/09/04 23:10:15 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: print.c,v 1.2 2000/10/11 20:23:50 is Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -154,7 +154,7 @@ void dump_raw (buf, len) for (i = 0; i < len; i++) { if ((i & 15) == 0) { if (lbix) - log_info (lbuf); + log_info ("%s", lbuf); sprintf (lbuf, "%03x:", i); lbix = 4; } else if ((i & 7) == 0) @@ -162,7 +162,7 @@ void dump_raw (buf, len) sprintf (&lbuf [lbix], " %02x", buf [i]); lbix += 3; } - log_info (lbuf); + log_info ("%s", lbuf); } void hash_dump (table) @@ -182,7 +182,7 @@ void hash_dump (table) if (bp -> len) dump_raw (bp -> name, bp -> len); else - log_info ((const char *)bp -> name); + log_info ("%s", (const char *)bp -> name); } } } @@ -1193,8 +1193,8 @@ void print_dns_status (int status, ns_updque *uq) *s++ = '.'; *s++ = 0; if (errorp) - log_error (obuf); + log_error ("%s", obuf); else - log_info (obuf); + log_info ("%s", obuf); } #endif /* NSUPDATE */ diff --git a/usr.sbin/dhcp/minires/res_update.c b/usr.sbin/dhcp/minires/res_update.c index 58016eb2c51a..ffb13fbd63b2 100644 --- a/usr.sbin/dhcp/minires/res_update.c +++ b/usr.sbin/dhcp/minires/res_update.c @@ -1,5 +1,5 @@ #if !defined(lint) && !defined(SABER) -static const char rcsid[] = "$Id: res_update.c,v 1.1.1.4 2000/07/20 05:50:24 mellon Exp $"; +static const char rcsid[] = "$Id: res_update.c,v 1.2 2000/10/11 20:23:51 is Exp $"; #endif /* not lint */ /* @@ -73,7 +73,8 @@ struct zonegrp { static int nscopy(struct sockaddr_in *, const struct sockaddr_in *, int); static int nsprom(struct sockaddr_in *, const struct in_addr *, int); -static void dprintf(const char *, ...); +static void dprintf(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); void tkey_free (ns_tsig_key **); diff --git a/usr.sbin/dhcp/omapip/errwarn.c b/usr.sbin/dhcp/omapip/errwarn.c index 2928b6fe1bb6..42d1f9a156c7 100644 --- a/usr.sbin/dhcp/omapip/errwarn.c +++ b/usr.sbin/dhcp/omapip/errwarn.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: errwarn.c,v 1.1.1.3 2000/09/04 23:10:32 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: errwarn.c,v 1.2 2000/10/11 20:23:51 is Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include @@ -68,7 +68,8 @@ void log_fatal (const char * fmt, ... ) do_percentm (fbuf, fmt); va_start (list, fmt); - vsnprintf (mbuf, sizeof mbuf, fbuf, list); + fmt = fbuf; + vsnprintf (mbuf, sizeof mbuf, fmt, list); va_end (list); #ifndef DEBUG @@ -114,7 +115,8 @@ int log_error (const char * fmt, ...) do_percentm (fbuf, fmt); va_start (list, fmt); - vsnprintf (mbuf, sizeof mbuf, fbuf, list); + fmt = fbuf; + vsnprintf (mbuf, sizeof mbuf, fmt, list); va_end (list); #ifndef DEBUG @@ -138,7 +140,8 @@ int log_info (const char *fmt, ...) do_percentm (fbuf, fmt); va_start (list, fmt); - vsnprintf (mbuf, sizeof mbuf, fbuf, list); + fmt = fbuf; + vsnprintf (mbuf, sizeof mbuf, fmt, list); va_end (list); #ifndef DEBUG @@ -162,7 +165,8 @@ int log_debug (const char *fmt, ...) do_percentm (fbuf, fmt); va_start (list, fmt); - vsnprintf (mbuf, sizeof mbuf, fbuf, list); + fmt = fbuf; + vsnprintf (mbuf, sizeof mbuf, fmt, list); va_end (list); #ifndef DEBUG diff --git a/usr.sbin/dhcp/relay/dhcrelay.c b/usr.sbin/dhcp/relay/dhcrelay.c index 3a49ed2deb35..1197fba4350b 100644 --- a/usr.sbin/dhcp/relay/dhcrelay.c +++ b/usr.sbin/dhcp/relay/dhcrelay.c @@ -43,7 +43,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcrelay.c,v 1.6 2000/09/04 23:19:36 mellon Exp $ Copyright (c) 1997-2000 Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcrelay.c,v 1.7 2000/10/11 20:23:51 is Exp $ Copyright (c) 1997-2000 Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -107,10 +107,10 @@ struct server_list { struct sockaddr_in to; } *servers; -static char copyright [] = "Copyright 1997-2000 Internet Software Consortium."; -static char arr [] = "All rights reserved."; -static char message [] = "Internet Software Consortium DHCP Relay Agent"; -static char url [] = "For info, please visit http://www.isc.org/products/DHCP"; +static const char copyright [] = "Copyright 1997-2000 Internet Software Consortium."; +static const char arr [] = "All rights reserved."; +static const char message [] = "Internet Software Consortium DHCP Relay Agent"; +static const char url [] = "For info, please visit http://www.isc.org/products/DHCP"; int main (argc, argv, envp) int argc; diff --git a/usr.sbin/dhcp/server/dhcpd.c b/usr.sbin/dhcp/server/dhcpd.c index 358ea2b8653a..cb69a1d26f31 100644 --- a/usr.sbin/dhcp/server/dhcpd.c +++ b/usr.sbin/dhcp/server/dhcpd.c @@ -43,14 +43,14 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.22 2000/09/04 23:19:38 mellon Exp $ Copyright 1995-2000 Internet Software Consortium."; +"$Id: dhcpd.c,v 1.23 2000/10/11 20:23:51 is Exp $ Copyright 1995-2000 Internet Software Consortium."; #endif - static char copyright[] = + static const char copyright[] = "Copyright 1995-2000 Internet Software Consortium."; -static char arr [] = "All rights reserved."; -static char message [] = "Internet Software Consortium DHCP Server"; -static char url [] = "For info, please visit http://www.isc.org/products/DHCP"; +static const char arr [] = "All rights reserved."; +static const char message [] = "Internet Software Consortium DHCP Server"; +static const char url [] = "For info, please visit http://www.isc.org/products/DHCP"; #include "dhcpd.h" #include "version.h" diff --git a/usr.sbin/gspa/gspa/gsp_ass.h b/usr.sbin/gspa/gspa/gsp_ass.h index 744006036788..63ec3940168f 100644 --- a/usr.sbin/gspa/gspa/gsp_ass.h +++ b/usr.sbin/gspa/gspa/gsp_ass.h @@ -1,4 +1,4 @@ -/* $NetBSD: gsp_ass.h,v 1.6 2000/07/23 23:14:10 mycroft Exp $ */ +/* $NetBSD: gsp_ass.h,v 1.7 2000/10/11 20:23:52 is Exp $ */ /* * GSP assembler - definitions * @@ -145,8 +145,10 @@ void list_error(char *); void listing(void); symbol lookup(char *id, bool makeit); expr num_expr(int); -void p1err(char *fmt, ...); -void perr(char *fmt, ...); +void p1err(char *fmt, ...) + __attribute__((__format__(__printf__, 1, 2))); +void perr(char *fmt, ...) + __attribute__((__format__(__printf__, 1, 2))); void pseudo(int code, operand operands); void push_input(char *fn); void putcode(u_int16_t *, int); diff --git a/usr.sbin/gspa/gspa/gspa.c b/usr.sbin/gspa/gspa/gspa.c index 5b8bd63e6834..60613f9bdc29 100644 --- a/usr.sbin/gspa/gspa/gspa.c +++ b/usr.sbin/gspa/gspa/gspa.c @@ -1,4 +1,4 @@ -/* $NetBSD: gspa.c,v 1.6 2000/07/23 23:14:10 mycroft Exp $ */ +/* $NetBSD: gspa.c,v 1.7 2000/10/11 20:23:52 is Exp $ */ /* * GSP assembler main program * @@ -33,7 +33,7 @@ #include #ifndef lint -__RCSID("$NetBSD: gspa.c,v 1.6 2000/07/23 23:14:10 mycroft Exp $"); +__RCSID("$NetBSD: gspa.c,v 1.7 2000/10/11 20:23:52 is Exp $"); #endif #include @@ -287,7 +287,7 @@ void yyerror(char *err) { - perr(err); + perr("%s", err); longjmp(synerrjmp, 1); } diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index de9c0d51ce1c..477fca355978 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -1,4 +1,4 @@ -/* $NetBSD: displayq.c,v 1.17 1999/12/07 14:54:44 mrg Exp $ */ +/* $NetBSD: displayq.c,v 1.18 2000/10/11 20:23:52 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: displayq.c,v 1.17 1999/12/07 14:54:44 mrg Exp $"); +__RCSID("$NetBSD: displayq.c,v 1.18 2000/10/11 20:23:52 is Exp $"); #endif #endif /* not lint */ @@ -84,8 +84,8 @@ static int lflag; /* long output option */ static int rank; /* order to be printed (-1=none, 0=active) */ static long totsize; /* total print job size in bytes */ -static char *head0 = "Rank Owner Job Files"; -static char *head1 = "Total Size\n"; +static const char head0[] = "Rank Owner Job Files"; +static const char head1[] = "Total Size\n"; static void alarmer __P((int)); diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h index 7425bd026641..3b1fdd07fef5 100644 --- a/usr.sbin/lpr/common_source/lp.h +++ b/usr.sbin/lpr/common_source/lp.h @@ -1,4 +1,4 @@ -/* $NetBSD: lp.h,v 1.14 2000/04/16 14:43:58 mrg Exp $ */ +/* $NetBSD: lp.h,v 1.15 2000/10/11 20:23:52 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -109,7 +109,8 @@ char *checkremote __P((void)); int chk __P((char *)); void displayq __P((int)); void dump __P((char *, char *, int)); -void fatal __P((const char *, ...)); +void fatal __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); int getline __P((FILE *)); int getport __P((char *, int)); int getq __P((struct queue *(*[]))); diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 4043a26c2bbf..d04a6be74de5 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1,4 +1,4 @@ -/* $NetBSD: printjob.c,v 1.24 2000/09/26 17:44:38 itojun Exp $ */ +/* $NetBSD: printjob.c,v 1.25 2000/10/11 20:23:52 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -45,7 +45,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\ #if 0 static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95"; #else -__RCSID("$NetBSD: printjob.c,v 1.24 2000/09/26 17:44:38 itojun Exp $"); +__RCSID("$NetBSD: printjob.c,v 1.25 2000/10/11 20:23:52 is Exp $"); #endif #endif /* not lint */ @@ -130,7 +130,8 @@ static void opentty __P((void)); static void openrem __P((void)); static int print __P((int, char *)); static int printit __P((char *)); -static void pstatus __P((const char *, ...)); +static void pstatus __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); static char response __P((void)); static void scan_out __P((int, char *, int)); static char *scnline __P((int, char *, int)); diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c index 447f23c7374a..bdd0b9590775 100644 --- a/usr.sbin/lpr/lpd/recvjob.c +++ b/usr.sbin/lpr/lpd/recvjob.c @@ -1,4 +1,4 @@ -/* $NetBSD: recvjob.c,v 1.11 1997/10/05 15:21:46 mrg Exp $ */ +/* $NetBSD: recvjob.c,v 1.12 2000/10/11 20:23:52 is Exp $ */ /* * Copyright (c) 1983, 1993 @@ -45,7 +45,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\ #if 0 static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; #else -__RCSID("$NetBSD: recvjob.c,v 1.11 1997/10/05 15:21:46 mrg Exp $"); +__RCSID("$NetBSD: recvjob.c,v 1.12 2000/10/11 20:23:52 is Exp $"); #endif #endif /* not lint */ @@ -78,7 +78,8 @@ static char *sp = ""; static char tfname[NAME_MAX]; /* tmp copy of cf before linking */ static int chksize __P((int)); -static void frecverr __P((const char *, ...)); +static void frecverr __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); static int noresponse __P((void)); static void rcleanup __P((int)); static int read_number __P((char *)); diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index 20cdc620e195..c284db48a4ea 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpr.c,v 1.18 1998/07/27 00:52:01 mycroft Exp $ */ +/* $NetBSD: lpr.c,v 1.19 2000/10/11 20:23:52 is Exp $ */ /* * Copyright (c) 1983, 1989, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)lpr.c 8.4 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: lpr.c,v 1.18 1998/07/27 00:52:01 mycroft Exp $"); +__RCSID("$NetBSD: lpr.c,v 1.19 2000/10/11 20:23:52 is Exp $"); #endif #endif /* not lint */ @@ -108,7 +108,8 @@ static void card __P((int, const char *)); static void chkprinter __P((char *)); static void cleanup __P((int)); static void copy __P((int, char [])); -static void fatal2 __P((const char *, ...)); +static void fatal2 __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); static char *itoa __P((int)); static char *linked __P((char *)); static char *lmktemp __P((char *, int, int)); @@ -260,7 +261,7 @@ main(argc, argv) if (SC && ncopies > 1) fatal2("multiple copies are not allowed"); if (MC > 0 && ncopies > MC) - fatal2("only %d copies are allowed", MC); + fatal2("only %ld copies are allowed", MC); /* * Get the identity of the person doing the lpr using the same * algorithm as lprm. diff --git a/usr.sbin/map-mbone/mapper.c b/usr.sbin/map-mbone/mapper.c index 106962ee4dff..0e90e515d91f 100644 --- a/usr.sbin/map-mbone/mapper.c +++ b/usr.sbin/map-mbone/mapper.c @@ -1,4 +1,4 @@ -/* $NetBSD: mapper.c,v 1.4 1998/05/09 17:22:07 kleink Exp $ */ +/* $NetBSD: mapper.c,v 1.5 2000/10/11 20:23:53 is Exp $ */ /* Mapper for connections between MRouteD multicast routers. * Written by Pavel Curtis @@ -91,6 +91,10 @@ int get_number __P((int *var, int deflt, char ***pargv, int *pargc)); u_int32_t host_addr __P((char *name)); +#ifdef __STDC__ +void log(int severity, int syserr, const char *format, ...) + __attribute__((__format__(__printf__, 3, 4))); +#endif Node *find_node(addr, ptr) u_int32_t addr; @@ -160,7 +164,7 @@ Neighbor *find_neighbor(addr, node) */ #ifdef __STDC__ void -log(int severity, int syserr, char *format, ...) +log(int severity, int syserr, const char *format, ...) { va_list ap; char fmt[100]; @@ -189,7 +193,8 @@ log(severity, syserr, format, va_alist) if (severity == LOG_WARNING) strcat(fmt, "warning - "); strncat(fmt, format, 80); - vfprintf(stderr, fmt, ap); + format = fmt; + vfprintf(stderr, format, ap); if (syserr == 0) fprintf(stderr, "\n"); else diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c index 8c950522ecb5..b0e68f67e770 100644 --- a/usr.sbin/mrinfo/mrinfo.c +++ b/usr.sbin/mrinfo/mrinfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: mrinfo.c,v 1.7 1998/07/04 21:31:59 mrg Exp $ */ +/* $NetBSD: mrinfo.c,v 1.8 2000/10/11 20:23:53 is Exp $ */ /* * This tool requests configuration info from a multicast router @@ -67,7 +67,7 @@ static char rcsid[] = "@(#) Header: mrinfo.c,v 1.6 93/04/08 15:14:16 van Exp (LBL)"; #else -__RCSID("$NetBSD: mrinfo.c,v 1.7 1998/07/04 21:31:59 mrg Exp $"); +__RCSID("$NetBSD: mrinfo.c,v 1.8 2000/10/11 20:23:53 is Exp $"); #endif #endif @@ -104,6 +104,10 @@ void usage __P((void)); /* to shut up -Wstrict-prototypes */ int main __P((int argc, char *argv[])); +#ifdef __STDC__ +void log(int severity, int syserr, char *format, ...) + __attribute__((__format__(__printf__, 3, 4))); +#endif char * @@ -164,7 +168,8 @@ log(severity, syserr, format, va_alist) if (severity == LOG_WARNING) strcat(fmt, "warning - "); strncat(fmt, format, 80); - vfprintf(stderr, fmt, ap); + format = fmt; + vfprintf(stderr, format, ap); if (syserr == 0) fprintf(stderr, "\n"); else diff --git a/usr.sbin/mrouted/cfparse.y b/usr.sbin/mrouted/cfparse.y index 7c81ea8c13b2..18e4405e62b9 100644 --- a/usr.sbin/mrouted/cfparse.y +++ b/usr.sbin/mrouted/cfparse.y @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cfparse.y,v 1.5 1998/03/30 02:33:37 mrg Exp $ */ +/* $NetBSD: cfparse.y,v 1.6 2000/10/11 20:23:53 is Exp $ */ /* * Configuration file parser for mrouted. @@ -19,8 +19,10 @@ /* * Local function declarations */ -static void fatal __P((char *fmt, ...)); -static void warn __P((char *fmt, ...)); +static void fatal __P((char *fmt, ...)) + __attribute__((__format__(__printf__, 1, 2))); +static void warn __P((char *fmt, ...)) + __attribute__((__format__(__printf__, 1, 2))); static void yyerror __P((char *s)); static char * next_word __P((void)); static int yylex __P((void)); diff --git a/usr.sbin/mrouted/defs.h b/usr.sbin/mrouted/defs.h index 8708b89219ef..f217241aec97 100644 --- a/usr.sbin/mrouted/defs.h +++ b/usr.sbin/mrouted/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.7 1997/10/17 10:38:03 lukem Exp $ */ +/* $NetBSD: defs.h,v 1.8 2000/10/11 20:23:53 is Exp $ */ /* * The mrouted program is covered by the license in the accompanying file @@ -161,7 +161,8 @@ extern char * sys_errlist[]; #endif /* main.c */ -extern void log __P((int, int, char *, ...)); +extern void log __P((int, int, const char *, ...)) + __attribute__((__format__(__printf__, 3, 4))); extern int register_input_handler __P((int fd, ihfunc_t func)); /* igmp.c */ diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c index 9aca097ade37..b613bbdb7c15 100644 --- a/usr.sbin/mrouted/main.c +++ b/usr.sbin/mrouted/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.12 1999/06/06 03:27:06 thorpej Exp $ */ +/* $NetBSD: main.c,v 1.13 2000/10/11 20:23:53 is Exp $ */ /* * The mrouted program is covered by the license in the accompanying file @@ -33,7 +33,7 @@ #include #ifndef lint -__RCSID("@(#) $NetBSD: main.c,v 1.12 1999/06/06 03:27:06 thorpej Exp $"); +__RCSID("@(#) $NetBSD: main.c,v 1.13 2000/10/11 20:23:53 is Exp $"); #endif #include @@ -79,6 +79,10 @@ static void resetlogging __P((void *)); /* To shut up gcc -Wstrict-prototypes */ int main __P((int argc, char **argv)); +#ifdef __STDC__ +void log(int severity, int syserr, const char *format, ...) + __attribute__((__format__(__printf__, 3, 4))); +#endif int register_input_handler(fd, func) @@ -643,7 +647,7 @@ resetlogging(arg) */ #ifdef __STDC__ void -log(int severity, int syserr, char *format, ...) +log(int severity, int syserr, const char *format, ...) { va_list ap; static char fmt[211] = "warning - "; @@ -684,9 +688,9 @@ log(severity, syserr, format, va_alist) gettimeofday(&now,NULL); t = now.tv_sec; thyme = localtime(&t); - strftime(tbuf, sizeof(tbuf), "%X.%%03d ", thyme); - fprintf(stderr, tbuf, now.tv_usec / 1000); - fprintf(stderr, "%s", msg); + strftime(tbuf, sizeof(tbuf), "%X", thyme); + fprintf(stderr, "%s.%03ld %s", tbuf, (long)now.tv_usec / 1000, + msg); if (syserr == 0) fprintf(stderr, "\n"); else diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c index da6817af44eb..33e95436aacb 100644 --- a/usr.sbin/mtrace/mtrace.c +++ b/usr.sbin/mtrace/mtrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtrace.c,v 1.14 2000/01/21 17:08:37 mycroft Exp $ */ +/* $NetBSD: mtrace.c,v 1.15 2000/10/11 20:23:53 is Exp $ */ /* * mtrace.c @@ -52,7 +52,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mtrace.c,v 1.14 2000/01/21 17:08:37 mycroft Exp $"); +__RCSID("$NetBSD: mtrace.c,v 1.15 2000/10/11 20:23:53 is Exp $"); #endif #include @@ -168,6 +168,10 @@ void check_vif_state __P((void)); void passive_mode __P((void)); int main __P((int argc, char *argv[])); +#ifdef __STDC__ +void log(int severity, int syserr, char *format, ...) + __attribute__((__format__(__printf__, 3, 4))); +#endif @@ -1738,7 +1742,8 @@ log(severity, syserr, format, va_alist) fmt[0] = '\0'; if (severity == LOG_WARNING) strcat(fmt, "warning - "); strncat(fmt, format, 80); - vfprintf(stderr, fmt, ap); + format = fmt; + vfprintf(stderr, format, ap); if (syserr == 0) fprintf(stderr, "\n"); else diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index 237382d4ff80..e36b0b5b3740 100644 --- a/usr.sbin/mtree/create.c +++ b/usr.sbin/mtree/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.25 1999/12/01 22:12:52 wennmach Exp $ */ +/* $NetBSD: create.c,v 1.26 2000/10/11 20:23:54 is Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.25 1999/12/01 22:12:52 wennmach Exp $"); +__RCSID("$NetBSD: create.c,v 1.26 2000/10/11 20:23:54 is Exp $"); #endif #endif /* not lint */ @@ -76,7 +76,8 @@ static char codebuf[4*MAXPATHLEN + 1]; static const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' }; static int dsort __P((const FTSENT **, const FTSENT **)); -static void output __P((int *, const char *, ...)); +static void output __P((int *, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); static int statd __P((FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *)); static void statf __P((FTSENT *)); @@ -191,7 +192,7 @@ statf(p) crc(fd, &val, &len)) mtree_err("%s: %s", p->fts_accpath, strerror(errno)); (void)close(fd); - output(&indent, "cksum=%lu", val); + output(&indent, "cksum=%lu", (long)val); } if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { if ((md5cp = MD5File(p->fts_accpath, md5buf)) == NULL) diff --git a/usr.sbin/mtree/extern.h b/usr.sbin/mtree/extern.h index 86a77b885ee7..e564f458d647 100644 --- a/usr.sbin/mtree/extern.h +++ b/usr.sbin/mtree/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.7 1999/12/07 18:42:06 wennmach Exp $ */ +/* $NetBSD: extern.h,v 1.8 2000/10/11 20:23:54 is Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -44,7 +44,8 @@ int compare __P((char *, NODE *, FTSENT *)); int crc __P((int, u_int32_t *, u_int32_t *)); void cwalk __P((void)); -void mtree_err __P((const char *, ...)); +void mtree_err __P((const char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); char *inotype __P((u_int)); u_int parsekey __P((char *, int *)); char *rlink __P((char *)); diff --git a/usr.sbin/pim6dd/debug.c b/usr.sbin/pim6dd/debug.c index ef5514863434..d2e7aa98d38f 100644 --- a/usr.sbin/pim6dd/debug.c +++ b/usr.sbin/pim6dd/debug.c @@ -1,4 +1,4 @@ -/* $NetBSD: debug.c,v 1.7 2000/05/19 10:43:36 itojun Exp $ */ +/* $NetBSD: debug.c,v 1.8 2000/10/11 20:23:54 is Exp $ */ /* * Copyright (c) 1998 by the University of Southern California. @@ -69,7 +69,7 @@ static char dumpfilename[] = _PATH_PIM6D_DUMP; static char cachefilename[] = _PATH_PIM6D_CACHE; /* TODO: notused */ static char *sec2str __P((time_t)); - + static char * sec2str(total) time_t total; diff --git a/usr.sbin/pim6sd/debug.h b/usr.sbin/pim6sd/debug.h index c713e24acf13..6db92274487e 100644 --- a/usr.sbin/pim6sd/debug.h +++ b/usr.sbin/pim6sd/debug.h @@ -1,4 +1,4 @@ -/* $NetBSD: debug.h,v 1.2 2000/05/19 10:43:47 itojun Exp $ */ +/* $NetBSD: debug.h,v 1.3 2000/10/11 20:23:54 is Exp $ */ /* * Copyright (C) 1999 LSIIT Laboratory. @@ -138,7 +138,8 @@ extern char *packet_kind __P((u_int proto, u_int type, u_int code)); extern int debug_kind __P((u_int proto, u_int type, u_int code)); -extern void log __P((int, int, char *, ...)); +extern void log __P((int, int, char *, ...)) + __attribute__((__format__(__printf__, 3, 4))); extern int log_level __P((u_int proto, u_int type, u_int code)); extern void dump __P((int i)); diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index bfc81e7d1338..1b07af32bcb8 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -1,11 +1,11 @@ -/* $NetBSD: perform.c,v 1.54 2000/10/01 12:23:21 hubertf Exp $ */ +/* $NetBSD: perform.c,v 1.55 2000/10/11 20:23:54 is Exp $ */ #include #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.54 2000/10/01 12:23:21 hubertf Exp $"); +__RCSID("$NetBSD: perform.c,v 1.55 2000/10/11 20:23:54 is Exp $"); #endif #endif @@ -369,7 +369,6 @@ pkg_do(char *pkg) * and we better stop right now. */ char *s; - char *fmt = NULL; int skip = -1; /* doing this right required to parse the full version(s), @@ -378,18 +377,17 @@ pkg_do(char *pkg) continue; /* would remove trailing '}' else */ if ((s = strpbrk(p->name, "<>")) != NULL) { - fmt = "%.*s-[0-9]*"; skip = 0; } else if ((s = strrchr(p->name, '-')) != NULL) { - fmt = "%.*s[0-9]*"; skip = 1; } - if (fmt != NULL) { + if (skip >= 0) { char buf[FILENAME_MAX]; - (void) snprintf(buf, sizeof(buf), fmt, - (int)(s - p->name) + skip, p->name); + (void) snprintf(buf, sizeof(buf), + skip ? "%.*s[0-9]*" : "%.*s-[0-9]*", + (int)(s - p->name) + skip, p->name); if (findmatchingname(dbdir, buf, note_whats_installed, installed) > 0) { warnx("pkg `%s' required, but `%s' found installed.", p->name, installed); diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index ca1066174685..b1e5f222efbc 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -1,11 +1,11 @@ -/* $NetBSD: file.c,v 1.41 2000/10/11 11:09:20 hubertf Exp $ */ +/* $NetBSD: file.c,v 1.42 2000/10/11 20:23:55 is Exp $ */ #include #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp"; #else -__RCSID("$NetBSD: file.c,v 1.41 2000/10/11 11:09:20 hubertf Exp $"); +__RCSID("$NetBSD: file.c,v 1.42 2000/10/11 20:23:55 is Exp $"); #endif #endif @@ -599,7 +599,7 @@ copy_file(char *dir, char *fname, char *to) (void) snprintf(cmd, sizeof(cmd), "cp -r %s %s", fname, to); else (void) snprintf(cmd, sizeof(cmd), "cp -r %s/%s %s", dir, fname, to); - if (vsystem(cmd)) { + if (vsystem("%s", cmd)) { cleanup(0); errx(2, "could not perform '%s'", cmd); } @@ -614,7 +614,7 @@ move_file(char *dir, char *fname, char *to) (void) snprintf(cmd, sizeof(cmd), "mv %s %s", fname, to); else (void) snprintf(cmd, sizeof(cmd), "mv %s/%s %s", dir, fname, to); - if (vsystem(cmd)) { + if (vsystem("%s", cmd)) { cleanup(0); errx(2, "could not perform '%s'", cmd); } diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h index f07a9b10c7fc..d0cd70ef386a 100644 --- a/usr.sbin/pkg_install/lib/lib.h +++ b/usr.sbin/pkg_install/lib/lib.h @@ -1,4 +1,4 @@ -/* $NetBSD: lib.h,v 1.30 2000/08/28 21:35:14 hubertf Exp $ */ +/* $NetBSD: lib.h,v 1.31 2000/10/11 20:23:55 is Exp $ */ /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */ @@ -165,7 +165,8 @@ typedef int (*matchfn) (const char *found, char *data); /* Prototypes */ /* Misc */ -int vsystem(const char *,...); +int vsystem(const char *,...) + __attribute__((__format__(__printf__, 1, 2))); void cleanup(int); char *make_playpen(char *, size_t, size_t); char *where_playpen(void); diff --git a/usr.sbin/pppd/pppd/options.c b/usr.sbin/pppd/pppd/options.c index bcab89c1a277..26dc8c44b779 100644 --- a/usr.sbin/pppd/pppd/options.c +++ b/usr.sbin/pppd/pppd/options.c @@ -1,4 +1,4 @@ -/* $NetBSD: options.c,v 1.33 2000/09/23 22:39:37 christos Exp $ */ +/* $NetBSD: options.c,v 1.34 2000/10/11 20:23:55 is Exp $ */ /* * options.c - handles option processing for PPP. @@ -24,7 +24,7 @@ #if 0 #define RCSID "Id: options.c,v 1.76 2000/08/01 01:38:30 paulus Exp " #else -__RCSID("$NetBSD: options.c,v 1.33 2000/09/23 22:39:37 christos Exp $"); +__RCSID("$NetBSD: options.c,v 1.34 2000/10/11 20:23:55 is Exp $"); #endif #endif @@ -280,7 +280,7 @@ option_t general_options[] = { #define IMPLEMENTATION "" #endif -static char *usage_string = "\ +static const char usage_string[] = "\ pppd version %s.%d%s\n\ Usage: %s [ options ], where options are:\n\ Communicate over the named device\n\ diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 15b4cd9e9171..152723da6d7a 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -1,4 +1,4 @@ -/* $NetBSD: pstat.c,v 1.52 2000/06/12 13:30:04 assar Exp $ */ +/* $NetBSD: pstat.c,v 1.53 2000/10/11 20:23:55 is Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)pstat.c 8.16 (Berkeley) 5/9/95"; #else -__RCSID("$NetBSD: pstat.c,v 1.52 2000/06/12 13:30:04 assar Exp $"); +__RCSID("$NetBSD: pstat.c,v 1.53 2000/10/11 20:23:55 is Exp $"); #endif #endif /* not lint */ @@ -713,7 +713,7 @@ kinfo_vnodes(avnodes) return ((struct e_vnode *)vbuf); } -char hdr[]=" LINE RAW CAN OUT HWT LWT COL STATE SESS PGID DISC\n"; +const char hdr[]=" LINE RAW CAN OUT HWT LWT COL STATE SESS PGID DISC\n"; int ttyspace = 128; void diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c index 0f794f0b4923..d48b59790958 100644 --- a/usr.sbin/rarpd/rarpd.c +++ b/usr.sbin/rarpd/rarpd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rarpd.c,v 1.38 2000/08/30 11:01:43 abs Exp $ */ +/* $NetBSD: rarpd.c,v 1.39 2000/10/11 20:23:55 is Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -28,7 +28,7 @@ __COPYRIGHT( #endif /* not lint */ #ifndef lint -__RCSID("$NetBSD: rarpd.c,v 1.38 2000/08/30 11:01:43 abs Exp $"); +__RCSID("$NetBSD: rarpd.c,v 1.39 2000/10/11 20:23:55 is Exp $"); #endif @@ -96,7 +96,8 @@ struct if_info { struct if_info *iflist; u_int32_t choose_ipaddr __P((u_int32_t **, u_int32_t, u_int32_t)); -void debug __P((const char *,...)); +void debug __P((const char *,...)) + __attribute__((__format__(__printf__, 1, 2))); void init_all __P((void)); void init_one __P((char *, u_int32_t)); u_int32_t ipaddrtonetmask __P((u_int32_t)); @@ -108,7 +109,8 @@ int rarp_open __P((char *)); void rarp_process __P((struct if_info *, u_char *)); void rarp_reply __P((struct if_info *, struct ether_header *, u_int32_t, struct hostent *)); -void rarperr __P((int, const char *,...)); +void rarperr __P((int, const char *,...)) + __attribute__((__format__(__printf__, 2, 3))); #if defined(__NetBSD__) #include "mkarp.h" diff --git a/usr.sbin/rbootd/utils.c b/usr.sbin/rbootd/utils.c index 9489ab2fd802..789dc18e95ee 100644 --- a/usr.sbin/rbootd/utils.c +++ b/usr.sbin/rbootd/utils.c @@ -1,4 +1,4 @@ -/* $NetBSD: utils.c,v 1.11 2000/03/27 17:07:23 kleink Exp $ */ +/* $NetBSD: utils.c,v 1.12 2000/10/11 20:23:56 is Exp $ */ /* * Copyright (c) 1988, 1992 The University of Utah and the Center @@ -51,7 +51,7 @@ #if 0 static char sccsid[] = "@(#)utils.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: utils.c,v 1.11 2000/03/27 17:07:23 kleink Exp $"); +__RCSID("$NetBSD: utils.c,v 1.12 2000/10/11 20:23:56 is Exp $"); #endif #endif /* not lint */ @@ -85,8 +85,8 @@ DispPkt(rconn, direct) RMPCONN *rconn; int direct; { - static char BootFmt[] = "\t\tRetCode:%u SeqNo:%lx SessID:%x Vers:%u"; - static char ReadFmt[] = "\t\tRetCode:%u Offset:%lx SessID:%x\n"; + static const char BootFmt[] = "\t\tRetCode:%u SeqNo:%lx SessID:%x Vers:%u"; + static const char ReadFmt[] = "\t\tRetCode:%u Offset:%lx SessID:%x\n"; struct tm *tmp; struct rmp_packet *rmp; @@ -141,7 +141,7 @@ DispPkt(rconn, direct) } (void) fputc('\n', DbgFp); (void) fprintf(DbgFp, BootFmt, rmp->r_brq.rmp_retcode, - t, ntohs(rmp->r_brq.rmp_session), + (unsigned long)t, ntohs(rmp->r_brq.rmp_session), ntohs(rmp->r_brq.rmp_version)); (void) fprintf(DbgFp, "\n\t\tMachine Type: "); for (i = 0; i < RMP_MACHLEN; i++) @@ -152,7 +152,7 @@ DispPkt(rconn, direct) fprintf(DbgFp, "\tBoot Reply:\n"); GETWORD(rmp->r_brpl.rmp_seqno, t); (void) fprintf(DbgFp, BootFmt, rmp->r_brpl.rmp_retcode, - t, ntohs(rmp->r_brpl.rmp_session), + (unsigned long)t, ntohs(rmp->r_brpl.rmp_session), ntohs(rmp->r_brpl.rmp_version)); DspFlnm(rmp->r_brpl.rmp_flnmsize,&rmp->r_brpl.rmp_flnm); break; @@ -160,7 +160,7 @@ DispPkt(rconn, direct) (void) fprintf(DbgFp, "\tRead Request:\n"); GETWORD(rmp->r_rrq.rmp_offset, t); (void) fprintf(DbgFp, ReadFmt, rmp->r_rrq.rmp_retcode, - t, ntohs(rmp->r_rrq.rmp_session)); + (unsigned long)t, ntohs(rmp->r_rrq.rmp_session)); (void) fprintf(DbgFp, "\t\tNoOfBytes: %u\n", ntohs(rmp->r_rrq.rmp_size)); break; @@ -168,7 +168,7 @@ DispPkt(rconn, direct) (void) fprintf(DbgFp, "\tRead Reply:\n"); GETWORD(rmp->r_rrpl.rmp_offset, t); (void) fprintf(DbgFp, ReadFmt, rmp->r_rrpl.rmp_retcode, - t, ntohs(rmp->r_rrpl.rmp_session)); + (unsigned long)t, ntohs(rmp->r_rrpl.rmp_session)); (void) fprintf(DbgFp, "\t\tNoOfBytesSent: %ld\n", (long)(rconn->rmplen - RMPREADSIZE(0))); break; diff --git a/usr.sbin/rpc.lockd/lock_proc.c b/usr.sbin/rpc.lockd/lock_proc.c index 71a4691ed30b..3263a0b986d7 100644 --- a/usr.sbin/rpc.lockd/lock_proc.c +++ b/usr.sbin/rpc.lockd/lock_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: lock_proc.c,v 1.6 2000/08/12 18:08:43 thorpej Exp $ */ +/* $NetBSD: lock_proc.c,v 1.7 2000/10/11 20:23:56 is Exp $ */ /* * Copyright (c) 1995 @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: lock_proc.c,v 1.6 2000/08/12 18:08:43 thorpej Exp $"); +__RCSID("$NetBSD: lock_proc.c,v 1.7 2000/10/11 20:23:56 is Exp $"); #endif #include @@ -227,7 +227,7 @@ get_client(host_addr, vers) freenetconfigent(nconf); if (!client) { - syslog(LOG_ERR, clnt_spcreateerror("clntudp_create")); + syslog(LOG_ERR, "%s", clnt_spcreateerror("clntudp_create")); syslog(LOG_ERR, "Unable to return result to %s", host); return NULL; } diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index cc104117fc3f..7e7ea4eab85f 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\ #if 0 static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: rwhod.c,v 1.17 1999/12/30 09:10:28 itojun Exp $"); +__RCSID("$NetBSD: rwhod.c,v 1.18 2000/10/11 20:23:56 is Exp $"); #endif #endif /* not lint */ @@ -385,7 +385,7 @@ void quit(msg) char *msg; { - syslog(LOG_ERR, msg); + syslog(LOG_ERR, "%s", msg); exit(1); } diff --git a/usr.sbin/sesd/srcs/sesd.c b/usr.sbin/sesd/srcs/sesd.c index 0d9a60fb37ba..d804a882f148 100644 --- a/usr.sbin/sesd/srcs/sesd.c +++ b/usr.sbin/sesd/srcs/sesd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sesd.c,v 1.2 2000/02/22 06:06:08 mjacob Exp $ */ +/* $NetBSD: sesd.c,v 1.3 2000/10/11 20:23:56 is Exp $ */ /* $FreeBSD: $ */ /* $OpenBSD: $ */ /* @@ -56,7 +56,7 @@ main(a, v) int a; char **v; { - static char *usage = + static const char usage[] = "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n"; int fd, polltime, dev, devbase, nodaemon; ses_encstat stat, *carray; diff --git a/usr.sbin/sup/source/log.c b/usr.sbin/sup/source/log.c index 1a0be0ed6a5c..e336a7f060a1 100644 --- a/usr.sbin/sup/source/log.c +++ b/usr.sbin/sup/source/log.c @@ -1,4 +1,4 @@ -/* $NetBSD: log.c,v 1.5 1999/08/24 15:52:53 bouyer Exp $ */ +/* $NetBSD: log.c,v 1.6 2000/10/11 20:23:57 is Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -88,7 +88,7 @@ va_dcl vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (opened) { - syslog (LOG_ERR,buf); + syslog (LOG_ERR, "%s", buf); closelog (); exit (retval); } @@ -118,7 +118,7 @@ va_dcl vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (opened) { - syslog (LOG_ERR,buf); + syslog (LOG_ERR, "%s", buf); return; } fprintf (stderr,"SUP: %s\n",buf); @@ -148,7 +148,7 @@ va_dcl vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (opened) { - syslog (LOG_INFO,buf); + syslog (LOG_INFO, "%s", buf); return; } printf ("%s\n",buf); @@ -195,7 +195,7 @@ va_dcl vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (opened) { - syslog (deny_severity, buf); + syslog (deny_severity, "%s", buf); return; } printf ("%s\n",buf); @@ -225,7 +225,7 @@ va_dcl vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (opened) { - syslog (allow_severity, buf); + syslog (allow_severity, "%s", buf); return; } printf ("%s\n",buf); diff --git a/usr.sbin/sup/source/supextern.h b/usr.sbin/sup/source/supextern.h index 32f82b539737..108eec65cc58 100644 --- a/usr.sbin/sup/source/supextern.h +++ b/usr.sbin/sup/source/supextern.h @@ -1,4 +1,4 @@ -/* $NetBSD: supextern.h,v 1.12 2000/07/21 16:03:14 tron Exp $ */ +/* $NetBSD: supextern.h,v 1.13 2000/10/11 20:23:57 is Exp $ */ struct stat; @@ -32,12 +32,17 @@ int filecopy __P((int, int )); /* log.c */ void logopen __P((char *)); -void logquit __P((int, char *, ...)); -void logerr __P((char *, ...)); -void loginfo __P((char *, ...)); +void logquit __P((int, char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); +void logerr __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))) ; +void loginfo __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); #ifdef LIBWRAP -void logdeny __P((char *, ...)); -void logallow __P((char *, ...)); +void logdeny __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); +void logallow __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); #endif /* netcryptvoid.c */ @@ -53,7 +58,8 @@ char *nxtarg __P((char **, char *)); void path __P((char *, char *, char *)); /* quit.c */ -void quit __P((int, char *, ...)); +void quit __P((int, char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); /* read_line.c */ char *read_line __P((FILE *, size_t *, size_t *, const char[3], int)); @@ -88,7 +94,8 @@ char *remotehost __P((void)); int thishost __P((char *)); int samehost __P((void)); int matchhost __P((char *)); -int scmerr __P((int, char *, ...)); +int scmerr __P((int, char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); int byteswap __P((int)); /* scmio.c */ @@ -141,8 +148,10 @@ int recvsym __P((TREE *, int, struct stat *)); int recvreg __P((TREE *, int, struct stat *)); int copyfile __P((char *, char *)); void finishup __P((int)); -void done __P((int, char *, ...)); -void goaway __P((char *, ...)); +void done __P((int, char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); +void goaway __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); /* supcmisc.c */ void prtime __P((void)); @@ -150,7 +159,8 @@ int establishdir __P((char *)); int makedir __P((char *, int, struct stat *)); int estabd __P((char *, char *)); void ugconvert __P((char *, char *, int *, int *, int *)); -void notify __P((char *, ...)); +void notify __P((char *, ...)) + __attribute__((__format__(__printf__, 1, 2))); void lockout __P((int)); char *fmttime __P((time_t)); diff --git a/usr.sbin/tcpdchk/Makefile b/usr.sbin/tcpdchk/Makefile index ce0d5c6fa370..98e1737ef597 100644 --- a/usr.sbin/tcpdchk/Makefile +++ b/usr.sbin/tcpdchk/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 1999/08/27 16:07:23 itojun Exp $ +# $NetBSD: Makefile,v 1.10 2000/10/11 20:23:57 is Exp $ PROG= tcpdchk SRCS= tcpdchk.c fakelog.c inetcf.c scaffold.c percent_m.c @@ -11,5 +11,3 @@ CPPFLAGS+= -I${.CURDIR}/../../lib/libwrap .include "${.CURDIR}/../../lib/libwrap/Makefile.cflags" .include - -CFLAGS= diff --git a/usr.sbin/tcpdchk/percent_m.h b/usr.sbin/tcpdchk/percent_m.h index 5c2bc62ca8cb..fc909c04c8e7 100644 --- a/usr.sbin/tcpdchk/percent_m.h +++ b/usr.sbin/tcpdchk/percent_m.h @@ -1,3 +1,4 @@ -/* $NetBSD: percent_m.h,v 1.1 1997/10/11 21:41:41 christos Exp $ */ +/* $NetBSD: percent_m.h,v 1.2 2000/10/11 20:23:57 is Exp $ */ -char *percent_m __P((char *, const char *)); +char *percent_m __P((char *, const char *)) + __attribute__((__format_arg__(2))); diff --git a/usr.sbin/tcpdump/print-bootp.c b/usr.sbin/tcpdump/print-bootp.c index 9020c542d683..d9f2f3298677 100644 --- a/usr.sbin/tcpdump/print-bootp.c +++ b/usr.sbin/tcpdump/print-bootp.c @@ -1,4 +1,4 @@ -/* $NetBSD: print-bootp.c,v 1.6 1999/07/02 11:31:31 itojun Exp $ */ +/* $NetBSD: print-bootp.c,v 1.7 2000/10/11 20:23:57 is Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -28,7 +28,7 @@ static const char rcsid[] = "@(#) Header: print-bootp.c,v 1.45 97/06/15 13:20:28 leres Exp (LBL)"; #else -__RCSID("$NetBSD: print-bootp.c,v 1.6 1999/07/02 11:31:31 itojun Exp $"); +__RCSID("$NetBSD: print-bootp.c,v 1.7 2000/10/11 20:23:57 is Exp $"); #endif #endif @@ -394,7 +394,7 @@ static void cmu_print(register const u_char *bp, register u_int length) { register const struct cmu_vend *cmu; - char *fmt = " %s:%s"; + const char fmt[] = " %s:%s"; #define PRINTCMUADDR(m, s) { TCHECK(cmu->m); \ if (cmu->m.s_addr != 0) \ diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 764a87518195..c7ff1916917d 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $NetBSD: user.c,v 1.24 2000/10/01 08:56:28 simonb Exp $ */ +/* $NetBSD: user.c,v 1.25 2000/10/11 20:23:58 is Exp $ */ /* * Copyright (c) 1999 Alistair G. Crooks. All rights reserved. @@ -36,7 +36,7 @@ __COPYRIGHT( "@(#) Copyright (c) 1999 \ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: user.c,v 1.24 2000/10/01 08:56:28 simonb Exp $"); +__RCSID("$NetBSD: user.c,v 1.25 2000/10/11 20:23:58 is Exp $"); #endif #include @@ -161,6 +161,9 @@ enum { #define UNSET_EXPIRY "Null (unset)" +static int asystem(const char *fmt, ...) + __attribute__((__format__(__printf__, 1, 2))); + static int verbose; /* if *cpp is non-null, free it, then assign `n' chars of `s' to it */ @@ -177,7 +180,7 @@ memsave(char **cpp, char *s, size_t n) /* a replacement for system(3) */ static int -asystem(char *fmt, ...) +asystem(const char *fmt, ...) { va_list vp; char buf[MaxCommandLen]; diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index df5b0f127a72..ca39642e3f0b 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -1,4 +1,4 @@ -/* $NetBSD: ypbind.c,v 1.42 2000/04/11 11:36:47 itojun Exp $ */ +/* $NetBSD: ypbind.c,v 1.43 2000/10/11 20:23:58 is Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt @@ -34,7 +34,7 @@ #include #ifndef LINT -__RCSID("$NetBSD: ypbind.c,v 1.42 2000/04/11 11:36:47 itojun Exp $"); +__RCSID("$NetBSD: ypbind.c,v 1.43 2000/10/11 20:23:58 is Exp $"); #endif #include @@ -135,7 +135,8 @@ int _yp_invalid_domain __P((const char *)); /* from libc */ int main __P((int, char *[])); static void usage __P((void)); -static void yp_log __P((int, const char *, ...)); +static void yp_log __P((int, const char *, ...)) + __attribute__((__format__(__printf__, 2, 3))); static struct _dom_binding *makebinding __P((const char *)); static int makelock __P((struct _dom_binding *)); static void removelock __P((struct _dom_binding *));