Skip to content

Commit

Permalink
Avoid segmentation fault loading config file with Windows \r\n line e…
Browse files Browse the repository at this point in the history
…ndings (#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.
  • Loading branch information
Frenzie authored Apr 2, 2024
1 parent 33a4bc6 commit c358285
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin-api/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit c358285

Please sign in to comment.