diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-02-12 19:22:14 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-02-12 19:22:14 +0000 |
commit | 63088a7c6ac1f0c43a7acc37b089905ab751e686 (patch) | |
tree | 1034e3f8e9cf55764658a5729b88229656d88021 | |
parent | 5b3f1bf918a0b889181cc0139234ce8b5debcbee (diff) |
Add missing \n to logit(), reverse logic on asprintf error so the error case
comes last.
ok henning@
-rw-r--r-- | usr.sbin/ifstated/ifstated.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c index c0b65f0a989..ba3cd9cab0d 100644 --- a/usr.sbin/ifstated/ifstated.c +++ b/usr.sbin/ifstated/ifstated.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifstated.c,v 1.8 2004/02/12 08:12:58 mcbride Exp $ */ +/* $OpenBSD: ifstated.c,v 1.9 2004/02/12 19:22:13 mcbride Exp $ */ /* * Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org> @@ -667,12 +667,12 @@ logit(int level, const char *fmt, ...) va_start(ap, fmt); if (opt_debug) { /* best effort in out of mem situations */ - if (asprintf(&nfmt, "ifstated: %s", fmt) == -1) { - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); - } else { + if (asprintf(&nfmt, "ifstated: %s\n", fmt) != -1) { vfprintf(stderr, nfmt, ap); free(nfmt); + } else { + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); } } else vsyslog(LOG_DAEMON, fmt, ap); |