From 6d9b6a8844e6ba3c9bb941809f12d3964997c015 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 10 Sep 2014 16:54:26 +0200 Subject: [PATCH] src/common.c: Fix strstripnewline(). Because the length of the string was decremented too late, the function would actually overwrite the trailing null byte instead of the newline. --- src/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 9c4e64f6..b771f62e 100644 --- a/src/common.c +++ b/src/common.c @@ -370,8 +370,8 @@ size_t strstripnewline (char *buffer) if ((buffer[buffer_len - 1] != '\n') && (buffer[buffer_len - 1] != '\r')) break; - buffer[buffer_len] = 0; buffer_len--; + buffer[buffer_len] = 0; } return (buffer_len); -- 2.30.2