aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/sdl_keyboard.c
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-05-24 11:21:59 +0200
committerLoïc Hoguin <[email protected]>2018-05-24 11:21:59 +0200
commit9868844f7f4d7c4fca164be610ef8f010a1255ee (patch)
treede2349664ef570e234acd006f001c7136910df38 /c_src/sdl_keyboard.c
parent51340fa75960ad44997175139eabd8e80753b4a3 (diff)
downloadesdl2-9868844f7f4d7c4fca164be610ef8f010a1255ee.tar.gz
esdl2-9868844f7f4d7c4fca164be610ef8f010a1255ee.tar.bz2
esdl2-9868844f7f4d7c4fca164be610ef8f010a1255ee.zip
Fix cppcheck warnings
Diffstat (limited to 'c_src/sdl_keyboard.c')
-rw-r--r--c_src/sdl_keyboard.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/c_src/sdl_keyboard.c b/c_src/sdl_keyboard.c
index d4b4233..c46cc75 100644
--- a/c_src/sdl_keyboard.c
+++ b/c_src/sdl_keyboard.c
@@ -282,9 +282,8 @@ NIF_CAST_HANDLER(thread_set_text_input_rect)
NIF_FUNCTION(set_text_input_rect)
{
- SDL_Rect* rect = NULL;
+ SDL_Rect* rect = (SDL_Rect*)enif_alloc(sizeof(SDL_Rect));
- rect = (SDL_Rect*)enif_alloc(sizeof(SDL_Rect));
if (!map_to_rect(env, argv[0], rect)) {
enif_free(rect);
return enif_make_badarg(env);