fix: Do not use NULL in arithmetic

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov 2024-08-03 21:03:52 +03:00 committed by Pugemon
parent 2cd6837da9
commit 7c8f04aa75
No known key found for this signature in database
GPG Key ID: 472FA343B3CC3287

View File

@ -115,8 +115,8 @@ std::string input_util::to_string(keycode code) {
char name[64];
int result =
GetKeyNameTextA(glfwGetKeyScancode(icode_repr) << 16, name, 64);
if (result == NULL) return "Unknown";
return std::string(name);
if (result == 0) return "Unknown";
return name;
#else
const char* name =
glfwGetKeyName(icode_repr, glfwGetKeyScancode(icode_repr));