Explorar el Código

Fix string-based hash table

Samuel Thibault hace 13 años
padre
commit
5bea7b3974
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/common/uthash.h

+ 1 - 1
src/common/uthash.h

@@ -229,7 +229,7 @@ do {
 #define HASH_FIND_STR(head,findstr,out)                                          \
 #define HASH_FIND_STR(head,findstr,out)                                          \
     HASH_FIND(hh,head,findstr,strlen(findstr),out)
     HASH_FIND(hh,head,findstr,strlen(findstr),out)
 #define HASH_ADD_STR(head,strfield,add)                                          \
 #define HASH_ADD_STR(head,strfield,add)                                          \
-    HASH_ADD(hh,head,strfield,strlen(add->strfield),add)
+    HASH_ADD(hh,head,strfield[0],strlen(add->strfield),add)
 #define HASH_FIND_INT(head,findint,out)                                          \
 #define HASH_FIND_INT(head,findint,out)                                          \
     HASH_FIND(hh,head,findint,sizeof(int),out)
     HASH_FIND(hh,head,findint,sizeof(int),out)
 #define HASH_ADD_INT(head,intfield,add)                                          \
 #define HASH_ADD_INT(head,intfield,add)                                          \