fix(command): update ProcessFile to use fixed file API

This commit is contained in:
phaneron 2025-03-16 01:20:10 -04:00
parent d5181697bd
commit 055fd56c69

View file

@ -363,21 +363,16 @@ static int32_t ProcessFile(const char* filename, PROCESSING* processing, CMDDEF*
}
auto size = OsGetFileSize(file);
auto buffer = reinterpret_cast<char*>(SMemAlloc(size + 1, __FILE__, __LINE__, 0));
size_t bytesread = 0;
int32_t bytesread;
OsReadFile(file, buffer, size, &bytesread);
OsCloseFile(file);
buffer[bytesread] = '\0';
const char* curr = buffer;
auto status = ProcessString(&curr, processing, nextarg, extracallback, errorcallback);
SMemFree(buffer, __FILE__, __LINE__, 0);
return status;
}