From 2fe7a36aab8c6c934550b2b8dc2074c1af23859a Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 2 Aug 2011 21:42:10 +0200 Subject: Accept variable length note names Read up to the first blank in note_read() instead of assuming a fixed-width note file name. Accept everything up to 40 characters (which is the length of a SHA1 hash in hexadecimal representation). Signed-off-by: Lukas Fleischer --- src/todo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/todo.c') diff --git a/src/todo.c b/src/todo.c index c489f51..3c0d1ba 100644 --- a/src/todo.c +++ b/src/todo.c @@ -334,14 +334,14 @@ todo_chg_priority (int action) struct todo *backup; char backup_mesg[BUFSIZ]; int backup_id; - char backup_note[NOTESIZ + 1]; + char backup_note[MAX_NOTESIZ + 1]; int do_chg = 1; backup = todo_get_item (hilt); (void)strncpy (backup_mesg, backup->mesg, strlen (backup->mesg) + 1); backup_id = backup->id; if (backup->note) - (void)strncpy (backup_note, backup->note, NOTESIZ + 1); + (void)strncpy (backup_note, backup->note, MAX_NOTESIZ + 1); else backup_note[0] = '\0'; switch (action) -- cgit v1.2.3-54-g00ecf