From f7dc6a713645fe66836d8729618daa422db7f464 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 10 Sep 2017 23:08:53 +1000 Subject: [PATCH] Attempt to get missing last line of quotes --- utils/magiedit/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/magiedit/main.c b/utils/magiedit/main.c index 02c6c91..ae8e19b 100644 --- a/utils/magiedit/main.c +++ b/utils/magiedit/main.c @@ -940,7 +940,9 @@ int main(int argc, char **argv) buffer[strlen(buffer) - 1] = '\0'; } else if (buffer[strlen(buffer) - 1] == '\n') { buffer[strlen(buffer) - 1] = '\r'; - } + } else { + buffer[strlen(buffer)+1] = '\0'; + buffer[strlen(buffer)] = '\r'; if (unwrapped_quote_len == 0) { unwrapped_quote = (char *)malloc(strlen(buffer) + 1); @@ -1007,7 +1009,7 @@ int main(int argc, char **argv) i = last_space + 1; } quote_line_count++; - } else if (unwrapped_quote[i] == '\r') { + } else if (unwrapped_quote[i] == '\r' ) { if (quote_line_count == 0) { quote_lines = (char **)malloc(sizeof(char *)); } else {