tries module: fix bug in trie_get_first_entry/2

This commit is contained in:
Ricardo Rocha
2010-02-22 14:01:56 +00:00
parent c3fb089eeb
commit 71a9be9742
6 changed files with 143 additions and 139 deletions

View File

@@ -431,7 +431,8 @@ TrNode core_trie_load(TrEngine engine, FILE *file, void (*load_function)(TrNode,
fpos_t curpos;
fscanf(file, "%14s", version);
if (fgetpos(file, &curpos) ) return NULL;
if (fgetpos(file, &curpos))
return NULL;
if (!strcmp(version, "BEGIN_TRIE_v2")) {
fseek(file, -11, SEEK_END);
@@ -442,7 +443,8 @@ TrNode core_trie_load(TrEngine engine, FILE *file, void (*load_function)(TrNode,
fprintf(stderr, "******************************************\n");
return NULL;
}
if (fsetpos(file, &curpos) ) return NULL;
if (fsetpos(file, &curpos))
return NULL;
CURRENT_LOAD_VERSION = 2;
} else if (!strcmp(version, "BEGIN_TRIE")) {
fseek(file, -8, SEEK_END);
@@ -453,7 +455,8 @@ TrNode core_trie_load(TrEngine engine, FILE *file, void (*load_function)(TrNode,
fprintf(stderr, "******************************************\n");
return NULL;
}
if (fsetpos(file, &curpos) ) return NULL;
if (fsetpos(file, &curpos))
return NULL;
CURRENT_LOAD_VERSION = 1;
} else {
fprintf(stderr, "****************************************\n");