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 d71b3a5 commit 39951beCopy full SHA for 39951be
Python/codecs.c
@@ -739,7 +739,9 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc)
739
}
740
assert(slen == 0 || PyUnicode_KIND(res) == PyUnicode_2BYTE_KIND);
741
Py_UCS2 *outp = PyUnicode_2BYTE_DATA(res);
742
- memset(outp, Py_UNICODE_REPLACEMENT_CHARACTER, sizeof(Py_UCS2) * slen);
+ for (Py_ssize_t i = 0; i < slen; ++i) {
743
+ outp[i] = Py_UNICODE_REPLACEMENT_CHARACTER;
744
+ }
745
assert(_PyUnicode_CheckConsistency(res, 1));
746
return Py_BuildValue("(Nn)", res, end);
747
0 commit comments