From 99234e7a9dc7a0a76c0122c2eab6846cef360f93 Mon Sep 17 00:00:00 2001 From: Michał Łyszczek Date: Thu, 20 May 2021 01:09:40 +0200 Subject: src/psmq-pub.c: fix extra bytes sent with stdin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When message was read from stdin, psmq-pub was publishing newline and null character. It was not suppose to do that. psmq-pub should send one message per newline, and it's common to not send new line character in that situation. Signed-off-by: Michał Łyszczek --- src/psmq-pub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psmq-pub.c b/src/psmq-pub.c index 0b9aa3d..63f0917 100644 --- a/src/psmq-pub.c +++ b/src/psmq-pub.c @@ -165,7 +165,7 @@ static void send_stdin /* now we have full line in buffer, ship * it. -1 is just so publish don't send * newline character */ - if (publish(psmq, topic, line, strlen(line) + 1, prio) != 0) + if (publish(psmq, topic, line, strlen(line) - 1, prio) != 0) return; } } -- cgit v1.2.3-8-gadcc