Commit 2835740b authored by VanillaSalt's avatar VanillaSalt

fix

parent 509d4a5c
......@@ -44,15 +44,10 @@ byte* default_script_reader(const char* script_name, int* slen) {
fp = fopen(script_name, "rb");
if (!fp)
return 0;
fseek(fp, 0, SEEK_END);
uint32 len = ftell(fp);
if (len > sizeof(buffer)) {
fclose(fp);
return 0;
}
fseek(fp, 0, SEEK_SET);
fread(buffer, len, 1, fp);
int len = fread(buffer, 1, sizeof(buffer), fp);
fclose(fp);
if(len >= sizeof(buffer))
return 0;
*slen = len;
return buffer;
}
......
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