diff options
-rw-r--r-- | ignore.c | 9 | ||||
-rw-r--r-- | rf.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/ignore.c b/ignore.c index e5e324c..c247692 100644 --- a/ignore.c +++ b/ignore.c @@ -21,8 +21,9 @@ struct ignores *init_ignores(char *path) { char *line = NULL; size_t llen = 0; total_size = IGNORE_SIZE; - struct ignores *ignores = calloc(sizeof(struct ignores), 1); - ignores->list = calloc(sizeof(char *), IGNORE_SIZE); + struct ignores *ignores = + (struct ignores *)calloc(sizeof(struct ignores), 1); + ignores->list = (char **)calloc(sizeof(char *), IGNORE_SIZE); ignores->size = 0; while (getline(&line, &llen, ignore) != -1) { @@ -36,7 +37,7 @@ struct ignores *init_ignores(char *path) { } if (strlen(line) > 0) { - char *l = calloc(sizeof(char), strlen(line)); + char *l = (char *)calloc(sizeof(char), strlen(line)); if (l == NULL) { fprintf(stderr, "calloc\n"); @@ -54,7 +55,7 @@ struct ignores *init_ignores(char *path) { } if (i + 1 > total_size) { - ignores->list = realloc( + ignores->list = (char **)realloc( ignores->list, sizeof(char *) * (total_size + IGNORE_SIZE)); total_size += IGNORE_SIZE; } diff --git a/rf.c b/rf.c index 7510027..bee1ea9 100644 --- a/rf.c +++ b/rf.c @@ -241,7 +241,7 @@ int main(int argc, char **argv) { if (optind < argc) { int i = 0; int pattern_count = argc - optind; - char **patterns = calloc(sizeof(char *), pattern_count); + char **patterns = (char **)calloc(sizeof(char *), pattern_count); memset(patterns, '\0', optind); |