diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 41c0c6cf85032ea713b4d1f90f8192daed1d7bbe
parent 914935013b5270f557aacff5d30fbb17cf1f2af3
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Wed, 29 Dec 2021 22:53:21 +0100

fix(unfold): buffer size

The buffer size does not need the +1 for the null byte, because we chop
off the first character (space or tab at the beginning of each line)
that was used for folding purposes. This will leave room for the \0 byte
without previous reservation.

Diffstat:
Msrc/utils.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/utils.c b/src/utils.c @@ -208,7 +208,7 @@ char* unfold(const char* str) { break; } - newbuf = realloc(buf, strlen(buf) + strlen(res) + 1); + newbuf = realloc(buf, strlen(buf) + strlen(res)); if (newbuf == NULL) { perror("realloc failed"); break;