From d18accdbcb8080821238d33b12f328ff1f5ab0be Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Tue, 12 Sep 2017 11:17:34 +1000 Subject: [PATCH] Attempt to fix niggling quote bug --- 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 128f8d8..92f8d3b 100644 --- a/utils/magiedit/main.c +++ b/utils/magiedit/main.c @@ -950,12 +950,13 @@ int main(int argc, char **argv) strcat(unwrapped_quote, buffer); unwrapped_quote_len = strlen(unwrapped_quote); } + fgets(buffer, 80, fptr); } fclose(fptr); unlink(msgtmp); - + // remove unneeded CRs for (i=0;i 71) { quote_lines[quote_line_count] = (char *)malloc(i - start_line + 6); memset(buffer, 0, 256); - strncpy(buffer, &unwrapped_quote[start_line], 74); + strncpy(buffer, &unwrapped_quote[start_line], (i - last_space > 71 ? 74 : 73)); sprintf(quote_lines[quote_line_count], " %c> %s", msgto[0], buffer); j = 0; start_line = i+1;