Revise todo_delete_note_bynum()

Pass an item instead of passing a list item index (analogous to commit
02c90ba53a).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-07-01 22:51:44 +02:00
parent 3f1359cdeb
commit 1c53c9d8c3
3 changed files with 3 additions and 9 deletions

View File

@@ -156,14 +156,8 @@ void todo_write(struct todo *todo, FILE * f)
}
/* Delete a note previously attached to a todo item. */
void todo_delete_note_bynum(unsigned num)
void todo_delete_note(struct todo *todo)
{
llist_item_t *i = LLIST_NTH(&todolist, num);
if (!i)
EXIT(_("no such todo"));
struct todo *todo = LLIST_TS_GET_DATA(i);
if (!todo->note)
EXIT(_("no note attached"));
erase_note(&todo->note);