about summary refs log tree commit diff
path: root/extrace.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-06-13 14:30:14 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-06-13 14:30:14 +0200
commit209186a54b574bc05a31ca8c9f083818104e025c (patch)
tree7edfaa5c6e6afde8195279d24dd09e705b8265a2 /extrace.c
parent38c2ac045171670992ecc709f937078a13deec72 (diff)
downloadextrace-209186a54b574bc05a31ca8c9f083818104e025c.tar.gz
extrace-209186a54b574bc05a31ca8c9f083818104e025c.tar.xz
extrace-209186a54b574bc05a31ca8c9f083818104e025c.zip
fix output
Diffstat (limited to 'extrace.c')
-rw-r--r--extrace.c21
1 files 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);
   }
 }