Skip to content

Commit

Permalink
Update Objects/unicodeobject.c
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Oct 20, 2023
1 parent eba2f84 commit 91e159c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3842,7 +3842,7 @@ PyUnicode_AsUTF8(PyObject *unicode)
{
Py_ssize_t size;
const char *utf8 = PyUnicode_AsUTF8AndSize(unicode, &size);
if (utf8 != NULL && strlen(utf8) != size) {
if (utf8 != NULL && strlen(utf8) != (size_t)size) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
return NULL;
}
Expand Down

0 comments on commit 91e159c

Please sign in to comment.