summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-09-07 02:53:24 -0500
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-09-07 02:53:24 -0500
commit9b8d802ca89027de46ee45fbc9adf978a16e7927 (patch)
treea7795bd687719df809f307ea4dd553a25ccbecda
parentf41ec6d42942f994f762486a9ab525ed8c5506e5 (diff)
downloadsegfault-9b8d802ca89027de46ee45fbc9adf978a16e7927.tar.gz
segfault-9b8d802ca89027de46ee45fbc9adf978a16e7927.zip
small fix with libhashtable's header
-rw-r--r--libhashtable/example.c5
-rw-r--r--libhashtable/hashtable.h (renamed from libhashtable/libhashtable.h)2
2 files changed, 3 insertions, 4 deletions
diff --git a/libhashtable/example.c b/libhashtable/example.c
index 614e440..bc42a67 100644
--- a/libhashtable/example.c
+++ b/libhashtable/example.c
@@ -1,5 +1,5 @@
#include <stdio.h>
-#include "libhashtable.h"
+#include "hashtable.h"
extern char **environ;
@@ -8,14 +8,13 @@ int main(int argc,char *argv[]) {
int i;
char *name;
char *value;
- inittable(&ht);
+ inittable(&ht,65535);
for(i=0;environ[i];i++) {
name=strdup(environ[i]);
if((value=strchr(name,'=') )){
*value=0;
value++;
}
- //printf("'%s' = '%s'\n",name,value);
ht_setkey(&ht,name,value);
free(name);
}
diff --git a/libhashtable/libhashtable.h b/libhashtable/hashtable.h
index 7899124..820d230 100644
--- a/libhashtable/libhashtable.h
+++ b/libhashtable/hashtable.h
@@ -15,7 +15,7 @@ struct hashtable {
int *keys;
};
unsigned short hash(char *v);//maybe use a seeded rand()? :) Thanks FreeArtMan
-void inittable(struct hashtable *ht);
+void inittable(struct hashtable *ht,int tsize);
int ht_setkey(struct hashtable *ht,char *key,char *value);
struct entry *ll_getentry(struct entry *start,char *msg);
struct entry *ht_getentry(struct hashtable *ht,char *key);