diff options
author | Jan Klemkow <web2p10@wemelug.de> | 2010-07-12 18:59:23 +0200 |
---|---|---|
committer | Jan Klemkow <web2p10@wemelug.de> | 2010-07-12 18:59:23 +0200 |
commit | 9b566cf3fd0a48107d273081b24f3cc6534e90f6 (patch) | |
tree | 3ac7cf81f604bbaa249b215a158fee570901f06a /src/sink.c | |
parent | 56c5f9340057766c66a7814ab71c111eb0d83cdb (diff) | |
download | pa-sink-ctl-9b566cf3fd0a48107d273081b24f3cc6534e90f6.tar.gz pa-sink-ctl-9b566cf3fd0a48107d273081b24f3cc6534e90f6.tar.bz2 pa-sink-ctl-9b566cf3fd0a48107d273081b24f3cc6534e90f6.zip |
wip: bugfix: interface
Diffstat (limited to 'src/sink.c')
-rw-r--r-- | src/sink.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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; } |