Skip to content

Commit

Permalink
Fix wrong argument check in the firmware functions (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrhyacinth committed Jul 19, 2020
1 parent 163e808 commit d05c584
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/luaSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ static int lua_totalspace(lua_State *L){
static int lua_firmware(lua_State *L){
int argc = lua_gettop(L);
#ifndef SKIP_ERROR_HANDLING
if (argc != 1) return luaL_error(L, "wrong number of arguments");
if (argc != 0) return luaL_error(L, "wrong number of arguments");
if (!unsafe_mode) return luaL_error(L, "this function requires unsafe mode");
#endif
char fw_str[8];
Expand All @@ -1137,7 +1137,7 @@ static int lua_firmware(lua_State *L){
static int lua_firmware2(lua_State *L){
int argc = lua_gettop(L);
#ifndef SKIP_ERROR_HANDLING
if (argc != 1) return luaL_error(L, "wrong number of arguments");
if (argc != 0) return luaL_error(L, "wrong number of arguments");
#endif
char fw_str[8];
SceKernelFwInfo info;
Expand All @@ -1151,7 +1151,7 @@ static int lua_firmware2(lua_State *L){
static int lua_firmware3(lua_State *L){
int argc = lua_gettop(L);
#ifndef SKIP_ERROR_HANDLING
if (argc != 1) return luaL_error(L, "wrong number of arguments");
if (argc != 0) return luaL_error(L, "wrong number of arguments");
if (!unsafe_mode) return luaL_error(L, "this function requires unsafe mode");
#endif
char fw_str[8];
Expand Down

0 comments on commit d05c584

Please sign in to comment.