From ddf8cb2acb7b0aacf52cadea54d95ac13d98f963 Mon Sep 17 00:00:00 2001 From: itojun Date: Fri, 7 Jul 2000 12:29:09 +0000 Subject: [PATCH] warnx?/errx? audit. don't pass variable/function return value alone. use with "%s". from openbsd. --- sbin/ccdconfig/ccdconfig.c | 12 ++++++------ sbin/disklabel/disklabel.c | 6 +++--- sbin/ping6/ping6.c | 12 ++++++------ sbin/swapctl/swapctl.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index 1bc256dee8c1..ff66108975c2 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccdconfig.c,v 1.30 2000/06/09 15:06:31 enami Exp $ */ +/* $NetBSD: ccdconfig.c,v 1.31 2000/07/07 12:29:09 itojun Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ __COPYRIGHT( "@(#) Copyright (c) 1996, 1997\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: ccdconfig.c,v 1.30 2000/06/09 15:06:31 enami Exp $"); +__RCSID("$NetBSD: ccdconfig.c,v 1.31 2000/07/07 12:29:09 itojun Exp $"); #endif #include @@ -499,8 +499,8 @@ do_io(path, cmd, cciop) #define KVM_ABORT(kd, str) { \ (void)kvm_close((kd)); \ - warnx((str)); \ - warnx(kvm_geterr((kd))); \ + warnx("%s", (str)); \ + warnx("%s", kvm_geterr((kd))); \ return (1); \ } @@ -637,7 +637,7 @@ print_ccd_info(cs, kd) readsize) != readsize) { printf("\n"); warnx("can't read component info"); - warnx(kvm_geterr(kd)); + warnx("%s", kvm_geterr(kd)); goto done; } @@ -647,7 +647,7 @@ print_ccd_info(cs, kd) cip[i].ci_pathlen) != cip[i].ci_pathlen) { printf("\n"); warnx("can't read component pathname"); - warnx(kvm_geterr(kd)); + warnx("%s", kvm_geterr(kd)); goto done; } printf((i + 1 < cs->sc_nccdisks) ? "%s " : "%s\n", path); diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 259b66a14c67..02051fac3732 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.84 2000/05/31 14:13:48 fvdl Exp $ */ +/* $NetBSD: disklabel.c,v 1.85 2000/07/07 12:29:10 itojun Exp $ */ /* * Copyright (c) 1987, 1993 @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\ static char sccsid[] = "@(#)disklabel.c 8.4 (Berkeley) 5/4/95"; /* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */ #else -__RCSID("$NetBSD: disklabel.c,v 1.84 2000/05/31 14:13:48 fvdl Exp $"); +__RCSID("$NetBSD: disklabel.c,v 1.85 2000/07/07 12:29:10 itojun Exp $"); #endif #endif /* not lint */ @@ -861,7 +861,7 @@ readlabel(f) } } if (msg != NULL) - errx(1, msg); + errx(1, "%s", msg); /* * There was no label on the disk. Get the fictious one * as a basis for initialisation. diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 85fec61abcb8..a32e2766b57e 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,5 +1,5 @@ -/* $NetBSD: ping6.c,v 1.15 2000/06/12 16:21:04 itojun Exp $ */ -/* $KAME: ping6.c,v 1.55 2000/06/12 16:18:32 itojun Exp $ */ +/* $NetBSD: ping6.c,v 1.16 2000/07/07 12:29:10 itojun Exp $ */ +/* $KAME: ping6.c,v 1.56 2000/07/07 12:17:15 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -81,7 +81,7 @@ static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; #else #include #ifndef lint -__RCSID("$NetBSD: ping6.c,v 1.15 2000/06/12 16:21:04 itojun Exp $"); +__RCSID("$NetBSD: ping6.c,v 1.16 2000/07/07 12:29:10 itojun Exp $"); #endif #endif @@ -547,9 +547,9 @@ main(argc, argv) #ifdef IPSEC_POLICY_IPSEC if (options & F_POLICY) { if (setpolicy(s, policy_in) < 0) - errx(1, ipsec_strerror()); + errx(1, "%s", ipsec_strerror()); if (setpolicy(s, policy_out) < 0) - errx(1, ipsec_strerror()); + errx(1, "%s", ipsec_strerror()); } #else if (options & F_AUTHHDR) { @@ -1901,7 +1901,7 @@ setpolicy(so, policy) buf = ipsec_set_policy(policy, strlen(policy)); if (buf == NULL) - errx(1, ipsec_strerror()); + errx(1, "%s", ipsec_strerror()); if (setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY, buf, ipsec_get_policylen(buf)) < 0) warnx("Unable to set IPSec policy"); diff --git a/sbin/swapctl/swapctl.c b/sbin/swapctl/swapctl.c index 6f7fe7a1fcf6..2aa459ab3473 100644 --- a/sbin/swapctl/swapctl.c +++ b/sbin/swapctl/swapctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: swapctl.c,v 1.14 2000/04/13 08:29:56 mrg Exp $ */ +/* $NetBSD: swapctl.c,v 1.15 2000/07/07 12:29:10 itojun Exp $ */ /* * Copyright (c) 1996, 1997, 1999 Matthew R. Green @@ -470,7 +470,7 @@ do_fstab(add) * Determine blk-ness. */ if (stat(spec, &st) < 0) { - warn(spec); + warn("%s", spec); continue; } if (S_ISBLK(st.st_mode))