From a7d4d3038a11fd8b6f8a1439840c2034ebb3ae01 Mon Sep 17 00:00:00 2001 From: dam Date: Thu, 30 Mar 2023 00:36:31 +0100 Subject: Fixed bug loading database. --- ttt.jai | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ttt.jai b/ttt.jai index 1d7edfb..4c79f86 100644 --- a/ttt.jai +++ b/ttt.jai @@ -753,9 +753,14 @@ load_database :: (db: *Database, path: string) -> success: bool { db.tasks.data = alloc(db.tasks.count * size_of(Task)); db.capacity = db.tasks.count; + // Read database tasks. + file_read(file, db.tasks.data, size_of(Task) * db.tasks.count); // TODO WIP WIP WIP Does this generate stable memory or temporary? + // Make sure we are reading all the file. + // TODO Clean this. WIP WIP WIP buffer: [1] u8; success, bytes := file_read(file, *buffer, 1); + print("'%'\n", buffer); assert(bytes == 0); print("done importing CSV with a bunch of hacks\n"); -- cgit v1.2.3