From 41ac4bd96f1c25366877c9cc82ff69b2ebaf6ebc Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Fri, 27 Mar 2020 08:23:07 +0100 Subject: Fix missing EOL in imported note Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/note.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/note.c b/src/note.c index 92c1ecf..2160874 100644 --- a/src/note.c +++ b/src/note.c @@ -59,9 +59,13 @@ HTABLE_PROTOTYPE(htp, note_gc_hash) char *generate_note(const char *str) { char *sha1 = mem_malloc(SHA1_DIGESTLEN * 2 + 1); - char *notepath; + char *notepath, *s; FILE *fp; + /* Temporary hack */ + asprintf(&s, "%s\n", str); + str = s; + sha1_digest(str, sha1); asprintf(¬epath, "%s%s", path_notes, sha1); fp = fopen(notepath, "w"); @@ -70,6 +74,7 @@ char *generate_note(const char *str) fputs(str, fp); file_close(fp, __FILE_POS__); + mem_free(s); mem_free(notepath); return sha1; } -- cgit v1.2.3-70-g09d2