warnx?/errx? audit. don't pass variable/function return value alone.

use with "%s".  from openbsd.
This commit is contained in:
itojun 2000-07-07 12:29:09 +00:00
parent fed1a1bf38
commit ddf8cb2acb
4 changed files with 17 additions and 17 deletions

View File

@ -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 <sys/param.h>
@ -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);

View File

@ -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.

View File

@ -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 <sys/cdefs.h>
#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");

View File

@ -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))