diff options
| author | 2015-10-29 22:41:27 +0000 | |
|---|---|---|
| committer | 2015-10-29 22:41:27 +0000 | |
| commit | 4ca18184ce93a6b4186cbfc2064e9278dabd25cc (patch) | |
| tree | 88d65e43ba05d97bef533e3764448265d5cdf630 /usr.sbin/cron/do_command.c | |
| parent | remove unused variables (diff) | |
| download | wireguard-openbsd-4ca18184ce93a6b4186cbfc2064e9278dabd25cc.tar.xz wireguard-openbsd-4ca18184ce93a6b4186cbfc2064e9278dabd25cc.zip | |
Use stravis(3) instead of a homegrown vis-like function.
OK nicm@
Diffstat (limited to 'usr.sbin/cron/do_command.c')
| -rw-r--r-- | usr.sbin/cron/do_command.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c index 17072b0d2e7..9aba71f3e3a 100644 --- a/usr.sbin/cron/do_command.c +++ b/usr.sbin/cron/do_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: do_command.c,v 1.50 2015/10/25 21:30:11 millert Exp $ */ +/* $OpenBSD: do_command.c,v 1.51 2015/10/29 22:41:27 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -18,6 +18,7 @@ */ #include "cron.h" +#include <vis.h> static void child_process(entry *, user *); @@ -125,10 +126,11 @@ child_process(entry *e, user *u) * PID is part of the log message. */ if ((e->flags & DONT_LOG) == 0) { - char *x = mkprints((u_char *)e->cmd, strlen(e->cmd)); - - log_it(usernm, getpid(), "CMD", x); - free(x); + char *x; + if (stravis(&x, e->cmd, 0) != -1) { + log_it(usernm, getpid(), "CMD", x); + free(x); + } } /* that's the last thing we'll log. close the log files. |
