Refactor out note deserialization

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2011-08-02 21:36:25 +02:00
parent c7b56ca556
commit bc97d60ef2
3 changed files with 12 additions and 8 deletions

View File

@@ -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);
}