We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5fd24e commit 1fad632Copy full SHA for 1fad632
stringdtype/stringdtype/src/dtype.c
@@ -146,15 +146,18 @@ static PyObject *
146
stringdtype_getitem(StringDTypeObject *NPY_UNUSED(descr), char **dataptr)
147
{
148
char *data;
149
+ size_t len;
150
151
if (*dataptr == NULL) {
152
data = "\0";
153
+ len = 0;
154
}
155
else {
156
data = ((ss *)dataptr)->buf;
157
+ len = ((ss *)dataptr)->len;
158
159
- PyObject *val_obj = PyUnicode_FromString(data);
160
+ PyObject *val_obj = PyUnicode_FromStringAndSize(data, len);
161
162
if (val_obj == NULL) {
163
return NULL;
0 commit comments