From b58978184c8a0394641977035c5c23fe73322606 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Mon, 20 Jun 2016 14:58:56 -0700 Subject: [PATCH] fix C99 issue, use malloc, not variable sized array. . --- examples/pybullet/pybullet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index fbd070ff9..eb1e88f6d 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -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; }