mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fixed a potential crash when an invalid Scancode constant argument is used in love.keyboard.getKeyFromScancode.
This commit is contained in:
@@ -84,7 +84,7 @@ int w_getKeyFromScancode(lua_State *L)
|
||||
const char *scancodestr = luaL_checkstring(L, 1);
|
||||
Keyboard::Scancode scancode;
|
||||
if (!Keyboard::getConstant(scancodestr, scancode))
|
||||
return luaL_error(L, "Invalid scancode: %s", scancode);
|
||||
return luaL_error(L, "Invalid scancode: %s", scancodestr);
|
||||
|
||||
Keyboard::Key key = instance()->getKeyFromScancode(scancode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user