mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-18 21:10:05 +00:00
fix C99 issue, use malloc, not variable sized array.
.
This commit is contained in:
parent
18e158ed38
commit
b58978184c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user