summaryrefslogtreecommitdiffstats
path: root/cras.c
diff options
context:
space:
mode:
Diffstat (limited to 'cras.c')
-rw-r--r--cras.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cras.c b/cras.c
index 7e63212..562ae0b 100644
--- a/cras.c
+++ b/cras.c
@@ -93,7 +93,6 @@ print_task(Task task, int i)
printf("%s\n", task.tdesc);
}
-
static void
print_short_output(TaskLst list)
{
@@ -176,7 +175,10 @@ store_input(TaskLst *list, FILE *fp)
if (fgets(linebuf, TASK_LST_DESC_MAX_SIZE, fp) == NULL)
break;
- linebuf[strlen(linebuf) - 1] = '\0'; /* Chomp '\n' */
+ /* Chomp '\n' */
+ if (linebuf[strlen(linebuf) - 1] == '\n')
+ linebuf[strlen(linebuf) - 1] = '\0';
+
if (task_lst_add_task(list, TASK_TODO, linebuf) < 0)
return -1;
}