diff options
| -rw-r--r-- | sdep.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -66,7 +66,7 @@ add_event(struct tm t, char *text, EventList *evlist) | |||
| 66 | EventNode *next = malloc(sizeof(EventNode)); | 66 | EventNode *next = malloc(sizeof(EventNode)); |
| 67 | 67 | ||
| 68 | next->ev.time = t; | 68 | next->ev.time = t; |
| 69 | next->ev.text = malloc(sizeof(char) * l); | 69 | next->ev.text = malloc(l); |
| 70 | strncpy(next->ev.text, text, l); | 70 | strncpy(next->ev.text, text, l); |
| 71 | next->ev.text = strtrim(next->ev.text); | 71 | next->ev.text = strtrim(next->ev.text); |
| 72 | next->next = NULL; | 72 | next->next = NULL; |
| @@ -107,9 +107,9 @@ default_op(void) | |||
| 107 | time_t t_now = time(NULL); | 107 | time_t t_now = time(NULL); |
| 108 | struct tm *now = localtime(&t_now); | 108 | struct tm *now = localtime(&t_now); |
| 109 | 109 | ||
| 110 | op.format_in = malloc(sizeof(char) * MAXLEN); | 110 | op.format_in = malloc(MAXLEN); |
| 111 | op.format_out = malloc(sizeof(char) * MAXLEN); | 111 | op.format_out = malloc(MAXLEN); |
| 112 | op.separator = malloc(sizeof(char) * MAXLEN); | 112 | op.separator = malloc(MAXLEN); |
| 113 | strcpy(op.format_in, default_format); | 113 | strcpy(op.format_in, default_format); |
| 114 | strcpy(op.format_out, default_format); | 114 | strcpy(op.format_out, default_format); |
| 115 | strcpy(op.separator, "\t"); | 115 | strcpy(op.separator, "\t"); |
