tries module: fix bug in trie_get_first_entry/2
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user