mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Fix zero-size calloc when enumerating a joystick with no hats in SDL.
git-svn-id: https://svn.eduke32.com/eduke32@2331 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
15532fa96a
commit
f5ed4014df
1 changed files with 2 additions and 1 deletions
|
@ -518,7 +518,8 @@ int32_t initinput(void)
|
|||
joynumaxes,joynumbuttons,joynumhats);
|
||||
|
||||
joyaxis = (int32_t *)Bcalloc(joynumaxes, sizeof(int32_t));
|
||||
joyhat = (int32_t *)Bcalloc(joynumhats, sizeof(int32_t));
|
||||
if (joynumhats)
|
||||
joyhat = (int32_t *)Bcalloc(joynumhats, sizeof(int32_t));
|
||||
|
||||
for (i = 0; i < joynumhats; i++)
|
||||
joyhat[i] = -1; // centre
|
||||
|
|
Loading…
Reference in a new issue