X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fq.c;h=0b19aa96f2b612c84cc2d3cbf3e9ffb76b2ba2eb;hp=0d0d944529a40e7681b9ab895d99c39b26be1e23;hb=b49af457d8554794e1550e3051a4fcd67a965d8a;hpb=35bef20c4bea1a43ea4072f0ea7ff5bbc68412ee diff --git a/lib/q.c b/lib/q.c index 0d0d944..0b19aa9 100644 --- a/lib/q.c +++ b/lib/q.c @@ -625,14 +625,16 @@ dict_t*dict_clone(dict_t*o) memcpy(h, o, sizeof(dict_t)); h->slots = h->hashsize?(dictentry_t**)rfx_calloc(sizeof(dictentry_t*)*h->hashsize):0; int t; - for(t=0;thashsize;t++) { - dictentry_t*e = h->slots[t]; + for(t=0;thashsize;t++) { + dictentry_t*e = o->slots[t]; while(e) { dictentry_t*n = (dictentry_t*)rfx_alloc(sizeof(dictentry_t)); memcpy(n, e, sizeof(dictentry_t)); - n->data = h->key_type->dup(e->data); + n->key = h->key_type->dup(e->key); + n->data = e->data; n->next = h->slots[t]; h->slots[t] = n; + e = e->next; } } return h;