diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2020-03-27 08:23:07 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2020-03-27 13:41:07 -0400 |
commit | 41ac4bd96f1c25366877c9cc82ff69b2ebaf6ebc (patch) | |
tree | bc5e85f1f7648c89707dda42f8194b4709f2bf81 | |
parent | e535eff9040eac07ca43c9db28aa2fd1a61f3b48 (diff) | |
download | calcurse-41ac4bd96f1c25366877c9cc82ff69b2ebaf6ebc.tar.gz calcurse-41ac4bd96f1c25366877c9cc82ff69b2ebaf6ebc.zip |
Fix missing EOL in imported note
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r-- | src/note.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } |