From 9b566cf3fd0a48107d273081b24f3cc6534e90f6 Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Mon, 12 Jul 2010 18:59:23 +0200 Subject: wip: bugfix: interface --- src/sink.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sink.c') 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; } -- cgit