OBS-URL: https://build.opensuse.org/request/show/58770 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/json-c?expand=0&rev=1
21 lines
565 B
Diff
21 lines
565 B
Diff
diff -Naur json-c-0.9.old//linkhash.c json-c-0.9//linkhash.c
|
|
--- json-c-0.9.old//linkhash.c 2009-12-15 23:53:18.000000000 +0000
|
|
+++ json-c-0.9//linkhash.c 2009-12-16 00:40:09.000000000 +0000
|
|
@@ -158,13 +158,15 @@
|
|
{
|
|
unsigned long h = t->hash_fn(k);
|
|
unsigned long n = h % t->size;
|
|
+ int count = 0;
|
|
|
|
t->lookups++;
|
|
- while( 1 ) {
|
|
+ while( count < t->size ) {
|
|
if(t->table[n].k == LH_EMPTY) return NULL;
|
|
if(t->table[n].k != LH_FREED &&
|
|
t->equal_fn(t->table[n].k, k)) return &t->table[n];
|
|
if(++n == t->size) n = 0;
|
|
+ count++;
|
|
}
|
|
return NULL;
|
|
}
|