diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2014-03-11 19:18:28 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2014-03-11 19:18:28 +0100 |
commit | 02deb090401bc84d5fe73b5bdc87e2b7a2ce856c (patch) | |
tree | c422d1edfc362f278d1e4b1df867ee3d91ce9c5a | |
parent | e2a4d351426433723d25c87ee6cc15b2a0b1c799 (diff) | |
download | extrace-02deb090401bc84d5fe73b5bdc87e2b7a2ce856c.tar.gz extrace-02deb090401bc84d5fe73b5bdc87e2b7a2ce856c.tar.xz extrace-02deb090401bc84d5fe73b5bdc87e2b7a2ce856c.zip |
convert newlines in cmdline to spaces
-rw-r--r-- | extrace.c | 4 |
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] = ' '; } |