summaryrefslogtreecommitdiff
path: root/src/sp_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_config.c')
-rw-r--r--src/sp_config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sp_config.c b/src/sp_config.c
index aeadd9d..4d95062 100644
--- a/src/sp_config.c
+++ b/src/sp_config.c
@@ -175,7 +175,11 @@ int sp_parse_config(const char *conf_file) {
175 while (getline(&lineptr, &n, fd) > 0) { 175 while (getline(&lineptr, &n, fd) > 0) {
176 /* We trash the terminal `\n`. This simplify the display of logs. */ 176 /* We trash the terminal `\n`. This simplify the display of logs. */
177 if (lineptr[strlen(lineptr) - 1] == '\n') { 177 if (lineptr[strlen(lineptr) - 1] == '\n') {
178 lineptr[strlen(lineptr) - 1] = '\0'; 178 if (lineptr[strlen(lineptr) - 2] == '\r') {
179 lineptr[strlen(lineptr) - 2] = '\0';
180 } else {
181 lineptr[strlen(lineptr) - 1] = '\0';
182 }
179 } 183 }
180 if (parse_line(lineptr) == -1) { 184 if (parse_line(lineptr) == -1) {
181 fclose(fd); 185 fclose(fd);