summaryrefslogtreecommitdiff
path: root/src/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sink.c')
-rw-r--r--src/sink.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sink.c b/src/sink.c
index 5abff14..38f061b 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -40,16 +40,22 @@ void sink_clear(sink_info* sink) {
void sink_check(sink_info** sink) {
+ if (sink == NULL)
+ printf("Error: sink = NULL\n");
+
if ((*sink) == NULL)
- (*sink) = (sink_info*) calloc(1, sizeof(sink_input_info));
+ (*sink) = sink_init();
+// (*sink) = (sink_info*) calloc(1, sizeof(sink_input_info));
}
/*
* check the list length and resize the list, if current position = max
*/
void sink_list_check(sink_info** sink_list, uint32_t* max, uint32_t counter) {
+
if (counter >= (*max)) {
(*max) *= 2;
sink_list = (sink_info**) realloc(sink_list, (*max) * sizeof(sink_info*));
+
for (int i = counter; i < (*max); ++i)
sink_list[i] = NULL;
}