summaryrefslogtreecommitdiffstats
path: root/tasklst.c
diff options
context:
space:
mode:
authorAriadna Vigo <arivigodr@gmail.com>2020-12-18 00:27:07 +0100
committerAriadna Vigo <arivigodr@gmail.com>2020-12-18 00:27:07 +0100
commit70000500ad92afcd29e21017c4cfb9ccfd034f77 (patch)
treea4751f2185980ecea00de1fc966f8fb6dc740dc5 /tasklst.c
parent9da5714bc65bf8cb322fd6e7623e86863023b154 (diff)
tasklst.c: now we can edit TaskLst entries
Diffstat (limited to 'tasklst.c')
-rw-r--r--tasklst.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tasklst.c b/tasklst.c
index d0916f1..83ffabf 100644
--- a/tasklst.c
+++ b/tasklst.c
@@ -125,6 +125,19 @@ task_lst_add_task(TaskLst *list, int status, const char *str)
newtask->next = NULL;
return 0;
+}
+
+int
+task_lst_edit_task(TaskLst *list, int i, const char *newstr)
+{
+ Task *edit;
+
+ if ((edit = task_lst_get_task(*list, i)) == NULL)
+ return -1;
+
+ strncpy(edit->tdesc, newstr, TASK_LST_DESC_MAX_SIZE);
+
+ return 0;
}
int