aboutsummaryrefslogtreecommitdiffstats
path: root/src/note.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-08-02 21:36:25 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-10-05 12:25:47 +0200
commitbc97d60ef2cacfe79875e6c604bf3f0e6d07fbd9 (patch)
tree97d70f3e80f0791f880eee5fdade6d15b59c9017 /src/note.c
parentc7b56ca556f4ffd3e6fe941356c6abc4d16967d4 (diff)
downloadcalcurse-bc97d60ef2cacfe79875e6c604bf3f0e6d07fbd9.tar.gz
calcurse-bc97d60ef2cacfe79875e6c604bf3f0e6d07fbd9.zip
Refactor out note deserialization
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/note.c')
-rw-r--r--src/note.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/note.c b/src/note.c
index 57bfc2d..91aae66 100644
--- a/src/note.c
+++ b/src/note.c
@@ -88,3 +88,12 @@ erase_note (char **note, enum eraseflg flag)
mem_free (*note);
*note = NULL;
}
+
+/* Read a serialized note file name from a stream and deserialize it. */
+void
+note_read (char *buffer, FILE *fp)
+{
+ (void)fgets (buffer, NOTESIZ + 1, fp);
+ buffer[NOTESIZ] = '\0';
+ getc (fp);
+}