Skip to content

Commit

Permalink
lua player: change sprintf to snprintf
Browse files Browse the repository at this point in the history
I doubt ill ever get a message larger than 512 bytes. but just 2 b sure...
  • Loading branch information
israpps committed Aug 4, 2023
1 parent f7340cf commit 5f9d3dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/luaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const char * runScript(const char* script, bool isStringBuffer )
if (s == LUA_OK) s = lua_pcall(L, 0, LUA_MULTRET, 0);

if (s != LUA_OK) {
sprintf((char*)errMsg, "%s\n", lua_tostring(L, -1));
snprintf((char*)errMsg, sizeof(char)*512, "%s\n", lua_tostring(L, -1));
//DPRINTF("%s\n", lua_tostring(L, -1));
lua_pop(L, 1); // remove error message
}
Expand Down

0 comments on commit 5f9d3dd

Please sign in to comment.