More fixes

This commit is contained in:
MysterD 2022-04-12 19:39:48 -07:00
parent c5c11a5a40
commit bf3c3bdccc
2 changed files with 3 additions and 2 deletions

View File

@ -135,6 +135,7 @@ void mod_cache_save(void) {
FILE* fp = fopen(filename, "wb");
if (fp == NULL) {
LOG_ERROR("Failed to open mod cache save fp: %s", filename);
return;
}
u16 version = MOD_CACHE_VERSION;
@ -143,7 +144,7 @@ void mod_cache_save(void) {
struct ModCacheEntry* node = sModCacheHead;
while (node != NULL) {
fwrite(node->dataHash, sizeof(u8), 16, fp);
fwrite(node->lastLoaded, sizeof(u64), 1, fp);
fwrite(&node->lastLoaded, sizeof(u64), 1, fp);
u16 pathLen = strlen(node->path);
fwrite(&pathLen, sizeof(u16), 1, fp);
fwrite(node->path, sizeof(u8), pathLen + 1, fp);

View File

@ -61,7 +61,7 @@ static void mark_groups_loaded_from_hash(void) {
if (mod->loadedFromCache) {
// if we loaded from cache, mark bytes as downloaded
sTotalDownloadBytes += mod->size;
LOG_INFO("Loaded from cache: %s, %llu", mod->name, mod->size);
LOG_INFO("Loaded from cache: %s, %llu", mod->name, (u64)mod->size);
} else {
// if we haven't loaded from cache, we need this offset group
u64 ogIndexStart = fileStartOffset / GROUP_SIZE;