diff --git a/config.mk b/config.mk index b50fe62..29863f1 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # feuille version -VERSION = 1.19.3 +VERSION = 1.19.4 # paths (customize them to fit your system) PREFIX = /usr/local diff --git a/feuille.1 b/feuille.1 index 22d65c8..a2eb8f9 100644 --- a/feuille.1 +++ b/feuille.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "feuille" "1" "November 2022" "feuille 1.19.3" "" +.TH "feuille" "1" "November 2022" "feuille 1.19.4" "" .hy .SH NAME .PP diff --git a/server.c b/server.c index ac11c81..c26384c 100644 --- a/server.c +++ b/server.c @@ -227,11 +227,14 @@ unsigned long read_paste(int connection, char **output) return 0; } - /* end the buffer with a newline */ - buffer[total_size] = '\n'; + /* end the buffer with a newline if there's none */ + if (buffer[total_size - 1] != '\n') { + buffer[total_size] = '\n'; + total_size++; /* add newline to total size */ + } *output = buffer; - return total_size + 1; /* newline */ + return total_size; } /**