From ccf53eef1685e77696fe94d78ca5e20afcb85c7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Miros=C5=82aw?= Date: Sat, 14 Jun 2008 02:29:05 +0200 Subject: [PATCH] src/common.c: Add end-of-line characters to strsplit() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes plugins that use it to break lines read using fgets() and forget that "\n" is left at the buffer's end. At least battery and wireless plugins is affected. Signed-off-by: Michał Mirosław Signed-off-by: Florian Forster --- src/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 5c3db5dd..56fa6962 100644 --- a/src/common.c +++ b/src/common.c @@ -224,7 +224,7 @@ int strsplit (char *string, char **fields, size_t size) i = 0; ptr = string; saveptr = NULL; - while ((fields[i] = strtok_r (ptr, " \t", &saveptr)) != NULL) + while ((fields[i] = strtok_r (ptr, " \t\r\n", &saveptr)) != NULL) { ptr = NULL; i++; -- 2.11.0