Remove _FORTIFY_SOURCE=0 and outrageous -O9 from makefile.
[SXSI/TextCollection.git] / swcsa / utils / hash.c
index a5be2d3..5512920 100755 (executable)
@@ -51,7 +51,7 @@ t_hash initialize_hash (unsigned long sizeVoc) {
        h->SIZE_HASH = sizeVoc;
        do {
          h->SIZE_HASH = NearestPrime(h->SIZE_HASH);
-       } while (h->SIZE_HASH < m);
+       } while (h->SIZE_HASH >= m);
 
        h->hash = (t_hashNode *) malloc(h->SIZE_HASH * sizeof(t_hashNode));
        h->NumElem = 0;
@@ -294,9 +294,7 @@ void insertElement (t_hash h, const unsigned char *aWord, register unsigned long
 
        if(h->NumElem >= h->SIZE_HASH/2)
        {
-        
         resize(h);
-
        }
        //h->hash[*addr].word = (unsigned char*) malloc((len+1) * sizeof(unsigned char));
        getMemoryBlock(h->_memMgr,( byte **)&(h->hash[*addr].word),len+1);