fix C99 issue, use malloc, not variable sized array.

.
This commit is contained in:
erwincoumans 2016-06-20 14:58:56 -07:00 committed by GitHub
parent 18e158ed38
commit b58978184c

View File

@ -707,7 +707,7 @@ pybullet_getJointPositions(PyObject* self, PyObject* args)
int i;
int numJoints = b3GetNumJoints(sm,bodyIndex);
double jointPositions[numJoints];
double* jointPositions = malloc(numJoints*sizeof(double));
pyListJointPos = PyTuple_New(numJoints);
@ -718,7 +718,7 @@ pybullet_getJointPositions(PyObject* self, PyObject* args)
item = PyFloat_FromDouble(jointPositions[i]);
PyTuple_SetItem(pyListJointPos, i, item);
}
free(jointPositions);
return pyListJointPos;
}