summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-03-11 19:18:28 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2014-03-11 19:18:28 +0100
commit02deb090401bc84d5fe73b5bdc87e2b7a2ce856c (patch)
treec422d1edfc362f278d1e4b1df867ee3d91ce9c5a
parente2a4d351426433723d25c87ee6cc15b2a0b1c799 (diff)
downloadextrace-02deb090401bc84d5fe73b5bdc87e2b7a2ce856c.tar.gz
extrace-02deb090401bc84d5fe73b5bdc87e2b7a2ce856c.tar.xz
extrace-02deb090401bc84d5fe73b5bdc87e2b7a2ce856c.zip
convert newlines in cmdline to spaces
-rw-r--r--extrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extrace.c b/extrace.c
index b799239..76b99ca 100644
--- a/extrace.c
+++ b/extrace.c
@@ -151,9 +151,9 @@ handle_msg(struct cn_msg *cn_hdr)
       r = read(fd, cmdline, sizeof cmdline);
       close(fd);
 
-      /* convert nuls (argument seperators) to spaces */
+      /* convert nuls (argument seperators) and newlines to spaces */
       for (i = 0; r > 0 && i < r; i++)
-        if (cmdline[i] == 0)
+        if (cmdline[i] == 0 || cmdline[i] == '\n')
           cmdline[i] = ' ';
     }