@@ -984,7 +984,7 @@ static char *List_iterGetName(JSOBJ Py_UNUSED(obj),
984984//=============================================================================
985985static void Index_iterBegin (JSOBJ Py_UNUSED (obj ), JSONTypeContext * tc ) {
986986 GET_TC (tc )-> index = 0 ;
987- GET_TC (tc )-> cStr = PyObject_Malloc (20 * sizeof ( char ) );
987+ GET_TC (tc )-> cStr = PyObject_Malloc (20 );
988988 if (!GET_TC (tc )-> cStr ) {
989989 PyErr_NoMemory ();
990990 }
@@ -998,10 +998,10 @@ static int Index_iterNext(JSOBJ obj, JSONTypeContext *tc) {
998998 const Py_ssize_t index = GET_TC (tc )-> index ;
999999 Py_XDECREF (GET_TC (tc )-> itemValue );
10001000 if (index == 0 ) {
1001- memcpy (GET_TC (tc )-> cStr , "name" , sizeof ( char ) * 5 );
1001+ memcpy (GET_TC (tc )-> cStr , "name" , 5 );
10021002 GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "name" );
10031003 } else if (index == 1 ) {
1004- memcpy (GET_TC (tc )-> cStr , "data" , sizeof ( char ) * 5 );
1004+ memcpy (GET_TC (tc )-> cStr , "data" , 5 );
10051005 GET_TC (tc )-> itemValue = get_values (obj );
10061006 if (!GET_TC (tc )-> itemValue ) {
10071007 return 0 ;
@@ -1033,7 +1033,7 @@ static char *Index_iterGetName(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc,
10331033static void Series_iterBegin (JSOBJ Py_UNUSED (obj ), JSONTypeContext * tc ) {
10341034 PyObjectEncoder * enc = (PyObjectEncoder * )tc -> encoder ;
10351035 GET_TC (tc )-> index = 0 ;
1036- GET_TC (tc )-> cStr = PyObject_Malloc (20 * sizeof ( char ) );
1036+ GET_TC (tc )-> cStr = PyObject_Malloc (20 );
10371037 enc -> outputFormat = VALUES ; // for contained series
10381038 if (!GET_TC (tc )-> cStr ) {
10391039 PyErr_NoMemory ();
@@ -1048,13 +1048,13 @@ static int Series_iterNext(JSOBJ obj, JSONTypeContext *tc) {
10481048 const Py_ssize_t index = GET_TC (tc )-> index ;
10491049 Py_XDECREF (GET_TC (tc )-> itemValue );
10501050 if (index == 0 ) {
1051- memcpy (GET_TC (tc )-> cStr , "name" , sizeof ( char ) * 5 );
1051+ memcpy (GET_TC (tc )-> cStr , "name" , 5 );
10521052 GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "name" );
10531053 } else if (index == 1 ) {
1054- memcpy (GET_TC (tc )-> cStr , "index" , sizeof ( char ) * 6 );
1054+ memcpy (GET_TC (tc )-> cStr , "index" , 6 );
10551055 GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "index" );
10561056 } else if (index == 2 ) {
1057- memcpy (GET_TC (tc )-> cStr , "data" , sizeof ( char ) * 5 );
1057+ memcpy (GET_TC (tc )-> cStr , "data" , 5 );
10581058 GET_TC (tc )-> itemValue = get_values (obj );
10591059 if (!GET_TC (tc )-> itemValue ) {
10601060 return 0 ;
@@ -1088,7 +1088,7 @@ static char *Series_iterGetName(JSOBJ Py_UNUSED(obj), JSONTypeContext *tc,
10881088static void DataFrame_iterBegin (JSOBJ Py_UNUSED (obj ), JSONTypeContext * tc ) {
10891089 PyObjectEncoder * enc = (PyObjectEncoder * )tc -> encoder ;
10901090 GET_TC (tc )-> index = 0 ;
1091- GET_TC (tc )-> cStr = PyObject_Malloc (20 * sizeof ( char ) );
1091+ GET_TC (tc )-> cStr = PyObject_Malloc (20 );
10921092 enc -> outputFormat = VALUES ; // for contained series & index
10931093 if (!GET_TC (tc )-> cStr ) {
10941094 PyErr_NoMemory ();
@@ -1103,13 +1103,13 @@ static int DataFrame_iterNext(JSOBJ obj, JSONTypeContext *tc) {
11031103 const Py_ssize_t index = GET_TC (tc )-> index ;
11041104 Py_XDECREF (GET_TC (tc )-> itemValue );
11051105 if (index == 0 ) {
1106- memcpy (GET_TC (tc )-> cStr , "columns" , sizeof ( char ) * 8 );
1106+ memcpy (GET_TC (tc )-> cStr , "columns" , 8 );
11071107 GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "columns" );
11081108 } else if (index == 1 ) {
1109- memcpy (GET_TC (tc )-> cStr , "index" , sizeof ( char ) * 6 );
1109+ memcpy (GET_TC (tc )-> cStr , "index" , 6 );
11101110 GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "index" );
11111111 } else if (index == 2 ) {
1112- memcpy (GET_TC (tc )-> cStr , "data" , sizeof ( char ) * 5 );
1112+ memcpy (GET_TC (tc )-> cStr , "data" , 5 );
11131113 Py_INCREF (obj );
11141114 GET_TC (tc )-> itemValue = obj ;
11151115 } else {
0 commit comments