8000 cjkcodecs: Fix compiler warning (GH-10651) · python/cpython@cdbcb77 · GitHub
[go: up one dir, main page]

Skip to content

Commit cdbcb77

Browse files
authored
cjkcodecs: Fix compiler warning (GH-10651)
Fixed the following compiler warning in multibytecodec.c: warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Cast Py_ssize_t to unsigned char: the maximum value is checked on the previous line.
1 parent a42de74 commit cdbcb77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/cjkcodecs/multibytecodec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEn
923923
PyErr_SetString(PyExc_UnicodeError, "pending buffer too large");
924924
return NULL;
925925
}
926-
statebytes[0] = pendingsize;
927-
memcpy(statebytes+1, pendingbuffer, pendingsize);
926+
statebytes[0] = (unsigned char)pendingsize;
927+
memcpy(statebytes + 1, pendingbuffer, pendingsize);
928928
statesize = 1 + pendingsize;
929929
} else {
930930
statebytes[0] = 0;

0 commit comments

Comments
 (0)
0