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