From f9f475674f3ffa9217e90047c83dd06c916ff42e Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 11 Apr 2007 07:48:03 +0000 Subject: Fixed ticket #219: Bug in hash table when key is PJ_HASH_KEY_STRING and hval is specified (thanks ChenHuan) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1186 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/hash.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pjlib/src') diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index dc7da673..5a97e5f1 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -133,6 +133,9 @@ static pj_hash_entry **find_entry( pj_pool_t *pool, pj_hash_table_t *ht, if (hval && *hval != 0) { hash = *hval; + if (keylen==PJ_HASH_KEY_STRING) { + keylen = pj_ansi_strlen((const char*)key); + } } else { /* This slightly differs with pj_hash_calc() because we need * to get the keylen when keylen is PJ_HASH_KEY_STRING. -- cgit v1.2.3