From: awolk Date: Sun, 11 Jun 2017 17:32:19 +0000 (+0000) Subject: usr/bin/ktrace: replace snprintf(3)/write(2) with dprintf(3) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c6ec1211d391175f8a67b29387637e404355389a;p=openbsd usr/bin/ktrace: replace snprintf(3)/write(2) with dprintf(3) Brought to attention by BlackFrog on #openbsd-daily OK deraadt@ --- diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c index 7864bc5bfea..1652d41533a 100644 --- a/usr.bin/ktrace/ktrace.c +++ b/usr.bin/ktrace/ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ktrace.c,v 1.33 2016/07/18 09:36:50 guenther Exp $ */ +/* $OpenBSD: ktrace.c,v 1.34 2017/06/11 17:32:19 awolk Exp $ */ /* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */ /*- @@ -250,10 +250,7 @@ usage(void) static void no_ktrace(int signo) { - char buf[8192]; - - snprintf(buf, sizeof(buf), + dprintf(STDERR_FILENO, "error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'option KTRACE'\n"); - write(STDERR_FILENO, buf, strlen(buf)); _exit(1); }