summaryrefslogtreecommitdiff
path: root/src/sink.c
diff options
context:
space:
mode:
authorJan Klemkow <web2p10@wemelug.de>2010-07-12 18:59:23 +0200
committerJan Klemkow <web2p10@wemelug.de>2010-07-12 18:59:23 +0200
commit9b566cf3fd0a48107d273081b24f3cc6534e90f6 (patch)
tree3ac7cf81f604bbaa249b215a158fee570901f06a /src/sink.c
parent56c5f9340057766c66a7814ab71c111eb0d83cdb (diff)
downloadpa-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.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;
}