summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-02-05 00:31:06 -0500
committerFurkan Sahin <furkan-dev@proton.me>2019-02-05 00:31:06 -0500
commit7e2403462d27be853d71a205f1a164d9d70905e1 (patch)
tree9a6e64165bc5c008386555520073c2a111bff7fa
parentf70a2dd370aa53fa45d054e4a490a12c8b4bd2b6 (diff)
swaynag: remove trailing newlines in config
Now that swaynag uses getline (instead of the old readline), the trailing newline characters have to be removed when reading the config
-rw-r--r--swaynag/config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/swaynag/config.c b/swaynag/config.c
index 40f3f65e..200611f4 100644
--- a/swaynag/config.c
+++ b/swaynag/config.c
@@ -348,6 +348,10 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) {
continue;
}
+ if (line[nread - 1] == '\n') {
+ line[nread - 1] = '\0';
+ }
+
if (line[0] == '[') {
char *close = strchr(line, ']');
if (!close) {