diff options
Diffstat (limited to 'test/runner.c')
-rw-r--r-- | test/runner.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/runner.c b/test/runner.c index e1aed70..9edd191 100644 --- a/test/runner.c +++ b/test/runner.c @@ -130,8 +130,10 @@ int main(int argc, char *argv[]) { ssize_t bytes_read = recvfrom(notify_sock, buf, sizeof(buf)-1, 0, &client_addr.gen, &client_size); if (bytes_read < 1) error(EXIT_FAILURE, errno, "recvfrom"); - buf[bytes_read] = '\n'; - bytes_read++; + if (buf[bytes_read-1] != '\n') { + buf[bytes_read] = '\n'; + bytes_read++; + } ssize_t bytes_written = 0; while (bytes_written < bytes_read) { ssize_t n = write(2, &(buf[bytes_written]), bytes_read-bytes_written); |