Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9dcffb

Browse files
author
Victor Stinner
committed
Fix 'c' format of PyUnicode_Format()
formatbuf is now an array of Py_UCS4, not of Py_UNICODE
1 parent c17f540 commit b9dcffb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12254,7 +12254,7 @@ PyUnicode_Format(PyObject *format, PyObject *args)
1225412254
case 'c':
1225512255
pbuf = formatbuf;
1225612256
kind = PyUnicode_4BYTE_KIND;
12257-
len = formatchar(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), v);
12257+
len = formatchar(pbuf, Py_ARRAY_LENGTH(formatbuf), v);
1225812258
if (len < 0)
1225912259
goto onError;
1226012260
break;

0 commit comments

Comments
 (0)