aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-22 10:25:46 +0100
committerGitHub <noreply@github.com>2018-11-22 10:25:46 +0100
commitcdbcb773f5db24e23fa90e644ec620d54bd08127 (patch)
tree885a3fe8db7b8a5b4992d9f922e3aad48e6c2cfd /Modules/cjkcodecs
parentbpo-35059: Cast void* to PyObject* (GH-10650) (diff)
downloadcpython-cdbcb773f5db24e23fa90e644ec620d54bd08127.tar.gz
cpython-cdbcb773f5db24e23fa90e644ec620d54bd08127.tar.bz2
cpython-cdbcb773f5db24e23fa90e644ec620d54bd08127.zip
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.
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 9409456c0d2..8a0ac870f15 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -923,8 +923,8 @@ _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEn
PyErr_SetString(PyExc_UnicodeError, "pending buffer too large");
return NULL;
}
- statebytes[0] = pendingsize;
- memcpy(statebytes+1, pendingbuffer, pendingsize);
+ statebytes[0] = (unsigned char)pendingsize;
+ memcpy(statebytes + 1, pendingbuffer, pendingsize);
statesize = 1 + pendingsize;
} else {
statebytes[0] = 0;