From c8cf0c1ce9cf1b38b302ae4a2a6fa798fef85f08 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Jun 2004 18:38:50 +0000 Subject: a bunch of fixes git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@10 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/idxset.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/idxset.c') diff --git a/src/idxset.c b/src/idxset.c index f0d7ad87..fe447ac6 100644 --- a/src/idxset.c +++ b/src/idxset.c @@ -152,8 +152,8 @@ int idxset_put(struct idxset*s, void *p, uint32_t *index) { s->hash_table[h] = e; /* Insert into array */ - extend_array(s, s->index); - a = array_index(s, s->index); + extend_array(s, e->index); + a = array_index(s, e->index); assert(a && !*a); *a = e; @@ -185,6 +185,9 @@ void* idxset_get_by_index(struct idxset*s, uint32_t index) { if (!(a = array_index(s, index))) return NULL; + if (!*a) + return NULL; + return (*a)->data; } -- cgit