mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Update Script.cpp
This commit is contained in:
parent
66599b5df3
commit
a09948770f
@ -95,7 +95,12 @@ void ScriptSrc::Process()
|
||||
// Go back to the beginning
|
||||
std::fseek(fp, 0, SEEK_SET);
|
||||
// Read the file contents into allocated data
|
||||
std::fread(&mData[0], 1, static_cast< size_t >(length), fp);
|
||||
size_t r = std::fread(&mData[0], 1, static_cast< size_t >(length), fp);
|
||||
// Read completely?
|
||||
if (r != static_cast< size_t >(length))
|
||||
{
|
||||
return SqThrowF("Failed to read script contents."); // Not cool
|
||||
}
|
||||
// Where the last line ended
|
||||
size_t line_start = 0, line_end = 0;
|
||||
// Process the file data and locate new lines
|
||||
|
Loading…
Reference in New Issue
Block a user