From b144b19964fcd5cfb99526641751823dea9bee9d Mon Sep 17 00:00:00 2001 From: Ambika Eshwar Date: Tue, 29 Sep 2020 02:16:25 -0400 Subject: Implemented rendering of notes in todo view Signed-off-by: Lukas Fleischer --- src/note.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/note.c') diff --git a/src/note.c b/src/note.c index 92c1ecf..40e0882 100644 --- a/src/note.c +++ b/src/note.c @@ -155,6 +155,17 @@ void note_read(char *buffer, FILE * fp) buffer[MAX_NOTESIZ] = '\0'; } +/* Read the contents of a note file */ +void note_read_contents(char *buffer, size_t buffer_len, FILE * fp) +{ + size_t read_count = fread(buffer, 1, buffer_len, fp); + if (read_count != buffer_len) + buffer[read_count] = '\0'; + else + memcpy(&buffer[buffer_len - 4], "...\0", 4); +} + + static void note_gc_extract_key(struct note_gc_hash *data, const char **key, int *len) { -- cgit v1.2.3-54-g00ecf