mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
fix(command): update ProcessFile to use fixed file API
This commit is contained in:
parent
d5181697bd
commit
055fd56c69
1 changed files with 1 additions and 6 deletions
|
|
@ -363,21 +363,16 @@ static int32_t ProcessFile(const char* filename, PROCESSING* processing, CMDDEF*
|
||||||
}
|
}
|
||||||
|
|
||||||
auto size = OsGetFileSize(file);
|
auto size = OsGetFileSize(file);
|
||||||
|
|
||||||
auto buffer = reinterpret_cast<char*>(SMemAlloc(size + 1, __FILE__, __LINE__, 0));
|
auto buffer = reinterpret_cast<char*>(SMemAlloc(size + 1, __FILE__, __LINE__, 0));
|
||||||
|
int32_t bytesread;
|
||||||
size_t bytesread = 0;
|
|
||||||
OsReadFile(file, buffer, size, &bytesread);
|
OsReadFile(file, buffer, size, &bytesread);
|
||||||
|
|
||||||
OsCloseFile(file);
|
OsCloseFile(file);
|
||||||
|
|
||||||
buffer[bytesread] = '\0';
|
buffer[bytesread] = '\0';
|
||||||
|
|
||||||
const char* curr = buffer;
|
const char* curr = buffer;
|
||||||
auto status = ProcessString(&curr, processing, nextarg, extracallback, errorcallback);
|
auto status = ProcessString(&curr, processing, nextarg, extracallback, errorcallback);
|
||||||
|
|
||||||
SMemFree(buffer, __FILE__, __LINE__, 0);
|
SMemFree(buffer, __FILE__, __LINE__, 0);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue