From 055fd56c6985be314a64bddcb17d32c2b0c23450 Mon Sep 17 00:00:00 2001 From: superp00t Date: Sun, 16 Mar 2025 01:20:10 -0400 Subject: [PATCH] fix(command): update ProcessFile to use fixed file API --- storm/Command.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/storm/Command.cpp b/storm/Command.cpp index 8032a4f..ba7c281 100644 --- a/storm/Command.cpp +++ b/storm/Command.cpp @@ -363,21 +363,16 @@ static int32_t ProcessFile(const char* filename, PROCESSING* processing, CMDDEF* } auto size = OsGetFileSize(file); - auto buffer = reinterpret_cast(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; }