summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eef2803)
raw | patch | inline | side by side (parent: eef2803)
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | |
Sat, 14 Jun 2008 00:29:05 +0000 (02:29 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 14 Jun 2008 15:52:37 +0000 (17:52 +0200) |
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 <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
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 <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/common.c | patch | blob | history |
diff --git a/src/common.c b/src/common.c
index 5c3db5ddacb53677d83e4d519f8b0c7331852449..56fa696279170c533b54438dc34e187bf18434d9 100644 (file)
--- a/src/common.c
+++ b/src/common.c
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++;