aboutsummaryrefslogtreecommitdiff
path: root/Converter
diff options
context:
space:
mode:
Diffstat (limited to 'Converter')
-rw-r--r--Converter/includes/array.h2
-rw-r--r--Converter/src/array.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/Converter/includes/array.h b/Converter/includes/array.h
index 003b1fd..7f96e57 100644
--- a/Converter/includes/array.h
+++ b/Converter/includes/array.h
@@ -10,7 +10,7 @@ typedef struct
size_t sz_used;
} array_t;
-void array_init(array_t *arr);
+void array_init(array_t **arr);
void array_append(array_t *arr, void *item);
void *array_read(array_t *arr, int index);
diff --git a/Converter/src/array.c b/Converter/src/array.c
index 442a4b5..650f31c 100644
--- a/Converter/src/array.c
+++ b/Converter/src/array.c
@@ -1,12 +1,12 @@
#include "../includes/array.h"
#include <malloc.h>
-void array_init(array_t *arr)
+void array_init(array_t **arr)
{
- arr = malloc(sizeof(*arr));
- arr->sz_used = 0;
- arr->sz_allocated = 8;
- arr->data = malloc(arr->sz_allocated);
+ (*arr) = malloc(sizeof(*arr));
+ (*arr)->sz_used = 0;
+ (*arr)->sz_allocated = 8;
+ (*arr)->data = malloc((*arr)->sz_allocated);
}
void array_append(array_t *arr, void *data)