Commit ac85ca8d authored by mercury233's avatar mercury233

fix

parent ae09b4aa
......@@ -341,9 +341,12 @@ byte* DataManager::ScriptReader(const char* script_name, int* slen) {
if(reader == NULL)
return 0;
size_t size = reader->getSize();
if(size > sizeof(scriptBuffer))
if(size > sizeof(scriptBuffer)) {
reader->drop();
return 0;
}
reader->read(scriptBuffer, size);
reader->drop();
*slen = size;
return scriptBuffer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment