Fix searching key with presented its length
[tedtools.git] / sfxstr.c
index 3eb12c4..4a4e4da 100644 (file)
--- a/sfxstr.c
+++ b/sfxstr.c
@@ -181,7 +181,7 @@ SFSFindDataFromSavedOrSave(SFSTree *info, SFSDataIO *in, SFSTreePosition *positi
                }
 
                if ( node->isskip ) {
-                       if ( in->keylen>0 &&  in->keylen - (((char*)ptr) - in->key) > node->nchar )
+                       if ( in->keylen>0 &&  in->keylen - (((char*)ptr) - in->key) < node->nchar )
                                return NULL;
                        else if ( STRNCMP(ptr, ((char*)node)+node->dataptr, node->nchar) ) {
                                ptr+=node->nchar;