From 663c4532f0dec4f34d36c425fbc03c37062ec951 Mon Sep 17 00:00:00 2001 From: Michael Skree Date: Thu, 1 Feb 2018 21:03:59 -0600 Subject: [PATCH] Ensure buffer contents are null-terminated Data added with `evbuffer_add` isn't null-terminated. This was causing extra characters to appear at the end of the output. Fixes: #174 --- daemon/remote.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/remote.c b/daemon/remote.c index cfe5810ea..29276189c 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2108,6 +2108,7 @@ static int flush(char const* rpcurl, tr_variant** benc) break; default: + evbuffer_add(buf, "", 1); fprintf(stderr, "Unexpected response: %s\n", evbuffer_pullup(buf, -1)); status |= EXIT_FAILURE; break; -- 2.40.0