dix: don't allow for devices with 0 axes
This just makes the existing behavior explicit, previously we relied on a malloc(numAxes * ...) to return NULL to error out.
This commit is contained in:
parent
5f48efa2bd
commit
7aba2514b2
|
@ -1335,6 +1335,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
|
||||||
ValuatorClassPtr valc;
|
ValuatorClassPtr valc;
|
||||||
|
|
||||||
BUG_RETURN_VAL(dev == NULL, FALSE);
|
BUG_RETURN_VAL(dev == NULL, FALSE);
|
||||||
|
BUG_RETURN_VAL(numAxes == 0, FALSE);
|
||||||
|
|
||||||
if (numAxes > MAX_VALUATORS) {
|
if (numAxes > MAX_VALUATORS) {
|
||||||
LogMessage(X_WARNING,
|
LogMessage(X_WARNING,
|
||||||
|
|
Loading…
Reference in New Issue