From 209186a54b574bc05a31ca8c9f083818104e025c Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 13 Jun 2016 14:30:14 +0200 Subject: fix output --- extrace.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/extrace.c b/extrace.c index 22194ee..59883e2 100644 --- a/extrace.c +++ b/extrace.c @@ -136,7 +136,6 @@ static void handle_msg(struct cn_msg *cn_hdr) { char cmdline[CMDLINE_MAX], name[PATH_MAX]; - char buf[CMDLINE_MAX]; char exe[PATH_MAX]; char cwd[PATH_MAX]; char *argvrest; @@ -181,20 +180,16 @@ handle_msg(struct cn_msg *cn_hdr) cwd[r3] = 0; } + fprintf(output, + "%*s%d %s%s%s", flat ? 0 : 2*d, "", + ev->event_data.exec.process_pid, + show_cwd ? cwd : "", show_cwd ? " % " : "", + exe); if (full_path && r2 > 0) - fprintf(output, - "%*s%d %s%s%s%s", flat ? 0 : 2*d, "", - ev->event_data.exec.process_pid, - show_cwd ? cwd : "", show_cwd ? " % " : "", - exe, - argvrest); + fprintf(output, "%s", argvrest); else - fprintf(output, - "%*s%d %s%s%s", flat ? 0 : 2*d, "", - ev->event_data.exec.process_pid, - show_cwd ? cwd : "", show_cwd ? " % " : "", - cmdline); - fprintf(output, "%s\n", buf); + fprintf(output, "%s", cmdline); + fprintf(output, "\n"); fflush(output); } } -- cgit 1.4.1