1433 static PyObject *
1434 ArmSubbufferTranIdentity_set_property (ArmSubbufferTranIdentity *self, PyObject *args)
1435 {
1436 int index;
1437 const char *name_ptr;
1438 const char *value_ptr;
1439 int i;
1440
1441 /*
1442 * Supported calling signatures:
1443 * set_property (index, name, value)
1444 */
1445 if (!PyArg_ParseTuple(args, "iss", &index, &name_ptr, &value_ptr))
when PyArg_ParseTuple() succeeds
taking False path
1446 return NULL;
1447 if ((index < ARM_PROPERTY_MIN_ARRAY_INDEX) || (index > ARM_PROPERTY_MAX_ARRAY_INDEX))
when considering range: 20 <= value <= 0x7fffffff
taking True path
1448 return NULL;
1449
1450 /* Allocate the property array as required */
1451 if (self->arm_buffer.identity_property_array == NULL)
1452 {
1453 self->arm_buffer.identity_property_array = calloc (sizeof (arm_property_t), ARM_PROPERTY_MAX_COUNT);
1454 for (i = 0; i < ARM_PROPERTY_MAX_COUNT; i++)
1455 {
1456 ((arm_property_t *) self->arm_buffer.identity_property_array) [i].name = NULL;
1457 ((arm_property_t *) self->arm_buffer.identity_property_array) [i].value = NULL;
1458 }
1459 }
1460
1461 /* Prevent memory loss when overwriting a value */
1462 ArmSubbufferTranIdentity_free_property (self, index);
1463
1464 /* Copy the names */
1465 ((arm_property_t *) self->arm_buffer.identity_property_array) [index].name = strndup (name_ptr, ARM_PROPERTY_NAME_MAX_CHARS);
1466 ((arm_property_t *) self->arm_buffer.identity_property_array) [index].value = strndup (name_ptr, ARM_PROPERTY_VALUE_MAX_CHARS);
1467
1468 Py_INCREF(Py_None);
1469 return Py_None;
1470 }
returning (PyObject*)NULL without setting an exception