From e5600ea6b030d9ffaa85b3ab0853a308e1062384 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 18 Jan 2019 14:58:13 -0800 Subject: [PATCH] Added missing fseek --- microstack/ILibSimpleDataStore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/microstack/ILibSimpleDataStore.c b/microstack/ILibSimpleDataStore.c index 1f04f83..662d95d 100644 --- a/microstack/ILibSimpleDataStore.c +++ b/microstack/ILibSimpleDataStore.c @@ -251,6 +251,10 @@ void ILibSimpleDataStore_RebuildKeyTable(ILibSimpleDataStore_Root *root) if (count == 0) { + ILibHashtable_ClearEx(root->keyTable, ILibSimpleDataStore_TableClear_Sink, root); // Wipe the key table, we will rebulit it + fseek(root->dataFile, 0, SEEK_SET); // See the start of the file + root->fileSize = -1; // Indicate we can't write to the data store + // Check if this is Legacy32 Format count = 0; while ((node = ILibSimpleDataStore_ReadNextRecord(root, 32)) != NULL)