summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/do_command.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-10-29 22:41:28 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-10-29 22:41:28 +0000
commitee793cc017e6aad1515ceac316bf7e3d12b8e2de (patch)
tree652a3239edbb3da6537d2faf9d918372836197ba /usr.sbin/cron/do_command.c
parent9916315845fb070ffe7d0bd5bb9e82055e343aa3 (diff)
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.c12
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.