]> granicus.if.org Git - python/commitdiff
Fix compiler warnings in the pystrehex module (GH-13730)
authorPablo Galindo <Pablogsal@gmail.com>
Sat, 1 Jun 2019 20:02:08 +0000 (21:02 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Jun 2019 20:02:08 +0000 (21:02 +0100)
Python/pystrhex.c

index 695a3c394e9b06af46f37f1fe99bd5c3e8dad878..5dc7c9613796e0cc847a8677d61523f12f3d7fdf 100644 (file)
@@ -11,11 +11,11 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
     PyObject *retval;
     Py_UCS1* retbuf;
     Py_ssize_t i, j, resultlen = 0;
-    Py_UCS1 sep_char;
+    Py_UCS1 sep_char = 0;
     unsigned int abs_bytes_per_sep;
 
     if (sep) {
-        Py_ssize_t seplen = PyObject_Length(sep);
+        Py_ssize_t seplen = PyObject_Length((PyObject*)sep);
         if (seplen < 0) {
             return NULL;
         }