blob: 75375139f6c8cf503061ac2204c280efc43c17d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
https://github.com/laurikari/tre/pull/49/commits/9c049c8c50a50a4f101aa45dd34bd138af7ed3cf
https://bugs.gentoo.org/932740
--- a/python/tre-python.c
+++ b/python/tre-python.c
@@ -365,7 +365,7 @@ PyTrePattern_search(TrePatternObject *self, PyObject *args)
if (PyUnicode_Check(pstring))
{
- Py_ssize_t len = PyUnicode_GetSize(pstring);
+ Py_ssize_t len = PyUnicode_GET_LENGTH(pstring);
wchar_t *buf = calloc(sizeof(wchar_t), len);
if(!buf)
{
@@ -502,7 +502,7 @@ PyTre_ncompile(PyObject *self, PyObject *args)
if (upattern != NULL)
{
- Py_ssize_t len = PyUnicode_GetSize(upattern);
+ Py_ssize_t len = PyUnicode_GET_LENGTH(upattern);
wchar_t *buf = calloc(sizeof(wchar_t), len);
if(!buf)
{
|