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:
helixhorned 2012-02-11 11:51:34 +00:00
parent 15532fa96a
commit f5ed4014df

View file

@ -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