Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin warnx?/errx? audit. don't pass variable/function retur...



details:   https://anonhg.NetBSD.org/src/rev/1d36c1ebbaca
branches:  trunk
changeset: 494513:1d36c1ebbaca
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Jul 07 12:29:09 2000 +0000

description:
warnx?/errx? audit.  don't pass variable/function return value alone.
use with "%s".  from openbsd.

diffstat:

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

diffs (133 lines):

diff -r f4350f501d1c -r 1d36c1ebbaca sbin/ccdconfig/ccdconfig.c
--- a/sbin/ccdconfig/ccdconfig.c        Fri Jul 07 12:22:32 2000 +0000
+++ b/sbin/ccdconfig/ccdconfig.c        Fri Jul 07 12:29:09 2000 +0000
@@ -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 @@
 
 #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 @@
            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 @@
                    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 -r f4350f501d1c -r 1d36c1ebbaca sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Fri Jul 07 12:22:32 2000 +0000
+++ b/sbin/disklabel/disklabel.c        Fri Jul 07 12:29:09 2000 +0000
@@ -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 @@
 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 @@
                        }
                }
                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 -r f4350f501d1c -r 1d36c1ebbaca sbin/ping6/ping6.c
--- a/sbin/ping6/ping6.c        Fri Jul 07 12:22:32 2000 +0000
+++ b/sbin/ping6/ping6.c        Fri Jul 07 12:29:09 2000 +0000
@@ -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 @@
 #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 @@
 #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 @@
 
        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 -r f4350f501d1c -r 1d36c1ebbaca sbin/swapctl/swapctl.c
--- a/sbin/swapctl/swapctl.c    Fri Jul 07 12:22:32 2000 +0000
+++ b/sbin/swapctl/swapctl.c    Fri Jul 07 12:29:09 2000 +0000
@@ -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 @@
                         * Determine blk-ness.
                         */
                        if (stat(spec, &st) < 0) {
-                               warn(spec);
+                               warn("%s", spec);
                                continue;
                        }
                        if (S_ISBLK(st.st_mode))



Home | Main Index | Thread Index | Old Index