sdep

A simple "date+event" line parser
git clone https://git.tronto.net/sdep
Download | Log | Files | Refs | README | LICENSE

commit 0e06db65fe8d44e349eee322d031c4b63e9603c8
parent 305581d247fc27892095b55d010b5d779d338ba5
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon, 15 May 2023 17:39:36 +0200

Removed unnecessary sizeof(char)

Diffstat:
Msdep.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sdep.c b/sdep.c @@ -66,7 +66,7 @@ add_event(struct tm t, char *text, EventList *evlist) EventNode *next = malloc(sizeof(EventNode)); next->ev.time = t; - next->ev.text = malloc(sizeof(char) * l); + next->ev.text = malloc(l); strncpy(next->ev.text, text, l); next->ev.text = strtrim(next->ev.text); next->next = NULL; @@ -107,9 +107,9 @@ default_op(void) time_t t_now = time(NULL); struct tm *now = localtime(&t_now); - op.format_in = malloc(sizeof(char) * MAXLEN); - op.format_out = malloc(sizeof(char) * MAXLEN); - op.separator = malloc(sizeof(char) * MAXLEN); + op.format_in = malloc(MAXLEN); + op.format_out = malloc(MAXLEN); + op.separator = malloc(MAXLEN); strcpy(op.format_in, default_format); strcpy(op.format_out, default_format); strcpy(op.separator, "\t");