From c358285c8db2c147577b9fd8e6a0ed2eeecedd9c Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Tue, 2 Apr 2024 21:57:56 +0200 Subject: [PATCH] Avoid segmentation fault loading config file with Windows \r\n line endings (#252) The problem doesn't seem to occur in Windows, only in Linux (and presumably *nix in general) when trying to load a config file that was created (and perhaps hand-edited) in Windows. --- src/plugin-api/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin-api/config.c b/src/plugin-api/config.c index 62bc370b..2ddad22c 100644 --- a/src/plugin-api/config.c +++ b/src/plugin-api/config.c @@ -199,7 +199,7 @@ void config_load(int is_global, char *fn) { data_pos = c; while (buffer[c]) { - if (buffer[c] == '\n') + if (buffer[c] == '\n' || buffer[c] == '\r') buffer[c] = 0; c++; }