At least one of the buildbots was complaining about newview being used

without being initialized.  Also make the code conform to the comment and
return the new object.  This code needs a test!
This commit is contained in:
Neal Norwitz 2007-10-07 19:26:50 +00:00
parent e43bd62b87
commit b35f128711

View file

@ -513,12 +513,11 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
else {
/* Return a new memory-view object */
Py_buffer newview;
PyMemoryView_FromMemory(&newview);
memset(&newview, 0, sizeof(newview));
return PyMemoryView_FromMemory(&newview);
}
}
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}