From 0d1bf4cec86ae81df5e0c995025e5a9c07e20d66 Mon Sep 17 00:00:00 2001
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Thu, 26 Feb 2009 20:28:55 -0200
Subject: [PATCH 22/31] Use the appropriate data types in Python bindings

When PyArg_ParseTuple() expects an int, it's better if we really give it
an int. Otherwise, if we use a larger data type, we might get garbage
because it will assume it's the size of an int.

We had some cases when that could happen, and this patch gets rid of them.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
---
 bindings/python/libjio.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bindings/python/libjio.c b/bindings/python/libjio.c
index 8ea6093..eb90e5a 100644
--- a/bindings/python/libjio.c
+++ b/bindings/python/libjio.c
@@ -166,7 +166,7 @@ static PyObject *jf_write(jfileobject *fp, PyObject *args)
 {
 	long rv;
 	unsigned char *buf;
-	long len;
+	int len;
 
 	if (!PyArg_ParseTuple(args, "s#:write", &buf, &len))
 		return NULL;
@@ -194,7 +194,7 @@ static PyObject *jf_pwrite(jfileobject *fp, PyObject *args)
 	long rv;
 	unsigned char *buf;
 	long long offset;
-	long len;
+	int len;
 
 	if (!PyArg_ParseTuple(args, "s#L:pwrite", &buf, &len, &offset))
 		return NULL;
@@ -409,7 +409,7 @@ It's a wrapper to jtrans_add().\n");
 static PyObject *jt_add(jtransobject *tp, PyObject *args)
 {
 	long rv;
-	long len;
+	int len;
 	long long offset;
 	unsigned char *buf;
 
-- 
1.6.2.rc0.226.gf08f

