Changeset 1353

Show
Ignore:
Timestamp:
08/11/07 18:24:35 (1 year ago)
Author:
till
Message:

- fix: searching the node list for a key '\0' works now

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeytrap/trunk/tools/ngtrie.c

    r1352 r1353  
    8989                        t = t->childlist; 
    9090                        if (t->key != curchar) { 
    91                                 while ((t->next) && (t->key) && (t->key != curchar)) t = t->next; 
     91                                while ((t->next) && (t->key != curchar)) t = t->next; 
    9292                                /* key not present, create new node */ 
    9393                                if (t->key != curchar) { 
     
    207207 
    208208        /* calculate vector lenghts and delete trie */  
     209        result = dotprod = sqrnorm1 = sqrnorm2 = 0; 
    209210        calc_and_del_trie(ngtrie); 
    210211 
    211212 
    212213        /* calculate similarity */ 
    213         result = dotprod = sqrnorm1 = sqrnorm2 = 0; 
    214214        if (isnan(result = 100-(100*acos(dotprod/(sqrt(sqrnorm1)*sqrt(sqrnorm2)))/1.5707963))) result = 100; 
    215215        fprintf(stdout, "Similarity: %.2f%%.\n", result); 
     216 
    216217 
    217218        if ((munmap(content[0], fs[0].st_size) != 0) || (munmap(content[1], fs[1].st_size) != 0)) {