git » libjio » commit 95a4c5d

Properly cast buffers in Python bindings

author Alberto Bertogli
2009-02-25 07:06:23 UTC
committer Alberto Bertogli
2009-02-25 07:48:31 UTC
parent 3aefb8d965efb6646a32459958b64989375d4449

Properly cast buffers in Python bindings

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

bindings/python/libjio.c +2 -2

diff --git a/bindings/python/libjio.c b/bindings/python/libjio.c
index 941d7b1..fcd61a3 100644
--- a/bindings/python/libjio.c
+++ b/bindings/python/libjio.c
@@ -110,7 +110,7 @@ static PyObject *jf_read(jfileobject *fp, PyObject *args)
 	if (rv < 0) {
 		r = PyErr_SetFromErrno(PyExc_IOError);
 	} else {
-		r = PyString_FromStringAndSize(buf, rv);
+		r = PyString_FromStringAndSize((char *) buf, rv);
 	}
 
 	free(buf);
@@ -147,7 +147,7 @@ static PyObject *jf_pread(jfileobject *fp, PyObject *args)
 	if (rv < 0) {
 		r = PyErr_SetFromErrno(PyExc_IOError);
 	} else {
-		r = PyString_FromStringAndSize(buf, rv);
+		r = PyString_FromStringAndSize((char *) buf, rv);
 	}
 
 	free(buf);