From fb6008be0b79a2a24b1ac960316a83f7873b4f39 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 20 Oct 2025 19:44:46 +0200 Subject: Add ! after c::fromstr calls to handle nomem Lazy way out, might be better to change API either by returning nomem or using `*char` as parameter so it's caller controlled instead of `str`. --- sdl2/keyboard.ha | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sdl2/keyboard.ha') diff --git a/sdl2/keyboard.ha b/sdl2/keyboard.ha index b9759dd..02cedae 100644 --- a/sdl2/keyboard.ha +++ b/sdl2/keyboard.ha @@ -635,7 +635,7 @@ export type SDL_Keysym = struct { @symbol("SDL_GetKeyFromName") fn _SDL_GetKeyFromName(name: *const c::char) SDL_Keycode; export fn SDL_GetKeyFromName(name: str) (SDL_Keycode | error) = { - const name = c::fromstr(name); + const name = c::fromstr(name)!; defer free(name); const sym = _SDL_GetKeyFromName(name); if (sym == SDL_Keycode::UNKNOWN) { -- cgit v1.2.3