Skip to content

Commit

Permalink
fix: fix a bug that caused todox to crash when using list arg
Browse files Browse the repository at this point in the history
This bug was cause because the task name length was being incorrectly
calculated, so the error 'corrupt size vs prev_size' was being thrown
when realocing the tasks array.
  • Loading branch information
matmatias committed Dec 29, 2023
1 parent e77225d commit 2513144
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int parseRegistry(FILE *taskRegistry, Task *out_tasks[], int *out_tasksLen) {
char *token = strtok(lineTmp, ",");

while (token) {
int taskNameLen = strlen(token) - 1;
int taskNameLen = strlen(token) + 1;
char *taskName = (char *)malloc(taskNameLen);
if (taskName == NULL) {
fprintf(stderr, "Memory allocation failed");
Expand Down

0 comments on commit 2513144

Please sign in to comment.