Skip to content

Commit

Permalink
Merge branch 'patch-api' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
salix5 committed Oct 9, 2024
2 parents d1059b3 + 26c8fbc commit ad23df8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void interpreter::unregister_group(group *pgroup) {
pgroup->ref_handle = 0;
}
int32 interpreter::load_script(const char* script_name) {
int32 len = 0;
int len = 0;
byte* buffer = ::read_script(script_name, &len);
if (!buffer)
return OPERATION_FAIL;
Expand Down
10 changes: 5 additions & 5 deletions ocgapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ byte* default_script_reader(const char* script_name, int* slen) {
FILE *fp;
fp = std::fopen(script_name, "rb");
if (!fp)
return 0;
int len = (int)fread(buffer, 1, sizeof(buffer), fp);
return nullptr;
size_t len = std::fread(buffer, 1, sizeof buffer, fp);
std::fclose(fp);
if(len >= sizeof(buffer))
return 0;
*slen = len;
if (len >= sizeof buffer)
return nullptr;
*slen = (int)len;
return buffer;
}
uint32 default_card_reader(uint32 code, card_data* data) {
Expand Down

0 comments on commit ad23df8

Please sign in to comment.