summaryrefslogtreecommitdiff
path: root/libhashtable/libhashtable.c
diff options
context:
space:
mode:
authorepochqwert <epoch@53flpnlls43fcguy.onion>2015-02-04 03:28:30 -0600
committerepochqwert <epoch@53flpnlls43fcguy.onion>2015-02-04 03:28:30 -0600
commite80dd3006171b33705395b0c7547f03925670bf9 (patch)
tree0588ce56dc4ab3cc824bb600698025e0c031bc63 /libhashtable/libhashtable.c
parent1b0d057b5068a5526aef1a5b1a2338d9f3bc6ef3 (diff)
downloadsegfault-e80dd3006171b33705395b0c7547f03925670bf9.tar.gz
segfault-e80dd3006171b33705395b0c7547f03925670bf9.zip
a round of warnings on Linux fixed.
Diffstat (limited to 'libhashtable/libhashtable.c')
-rw-r--r--libhashtable/libhashtable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libhashtable/libhashtable.c b/libhashtable/libhashtable.c
index 38b4ad3..02b981e 100644
--- a/libhashtable/libhashtable.c
+++ b/libhashtable/libhashtable.c
@@ -88,10 +88,11 @@ void ht_freevalues(struct hashtable *ht) {
//this seems too complicated.
int ht_setkey(struct hashtable *ht,char *key,void *value) {
- if(!key) key="(null)";
- unsigned short h=hash(key);
+ unsigned short h;
struct entry *tmp;
int i;
+ if(!key) key="(null)";
+ h=hash(key);
for(i=0;i<ht->kl;i++) {
if(ht->keys[i]==h) break;
}