mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix bug reported by sanitizer
This commit is contained in:
parent
49e025b565
commit
ad4aeaa1a0
@ -77,7 +77,7 @@ suggest(Dictionary *self, PyObject *args) {
|
|||||||
|
|
||||||
const std::vector<std::string>& word_list = self->handle->suggest(word);
|
const std::vector<std::string>& word_list = self->handle->suggest(word);
|
||||||
ans = PyTuple_New(word_list.size());
|
ans = PyTuple_New(word_list.size());
|
||||||
if (ans == NULL) PyErr_NoMemory();
|
if (ans == NULL) return PyErr_NoMemory();
|
||||||
Py_ssize_t i = 0;
|
Py_ssize_t i = 0;
|
||||||
for(auto const& s: word_list) {
|
for(auto const& s: word_list) {
|
||||||
temp = PyUnicode_Decode(s.c_str(), s.size(), self->encoding, "strict");
|
temp = PyUnicode_Decode(s.c_str(), s.size(), self->encoding, "strict");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user