mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +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);
|
joynumaxes,joynumbuttons,joynumhats);
|
||||||
|
|
||||||
joyaxis = (int32_t *)Bcalloc(joynumaxes, sizeof(int32_t));
|
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++)
|
for (i = 0; i < joynumhats; i++)
|
||||||
joyhat[i] = -1; // centre
|
joyhat[i] = -1; // centre
|
||||||
|
|
Loading…
Reference in a new issue