summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-07-07 20:24:03 +0200
committerFlorent Le Coz <louiz@louiz.org>2013-07-07 20:25:58 +0200
commit9b51377185be5049e29c8824949fad98db25ca91 (patch)
tree2be75ecccce5a1d7d90f50f28fcb9e7eae5823be /src
parentcae5f64931a75a9fdcb0ef523fc025f784e5a834 (diff)
downloadpoezio-9b51377185be5049e29c8824949fad98db25ca91.tar.gz
poezio-9b51377185be5049e29c8824949fad98db25ca91.tar.bz2
poezio-9b51377185be5049e29c8824949fad98db25ca91.tar.xz
poezio-9b51377185be5049e29c8824949fad98db25ca91.zip
Correctly use Py_ssize_t instead of int, fix a segfault on some architectures
Diffstat (limited to 'src')
-rw-r--r--src/pooptmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pooptmodule.c b/src/pooptmodule.c
index f085ab12..83b8bba8 100644
--- a/src/pooptmodule.c
+++ b/src/pooptmodule.c
@@ -67,7 +67,7 @@ static PyObject* poopt_cut_text(PyObject* self, PyObject* args)
/* Get the python arguments */
const size_t width;
const char* buffer;
- const int buffer_len;
+ const Py_ssize_t buffer_len;
if (PyArg_ParseTuple(args, "s#k", &buffer, &buffer_len, &width) == 0)
return NULL;
@@ -207,7 +207,7 @@ PyDoc_STRVAR(poopt_wcswidth_doc, "wcswidth(s)\n\n\nThe wcswidth() function retur
static PyObject* poopt_wcswidth(PyObject* self, PyObject* args)
{
const char* string;
- const int len;
+ const Py_ssize_t len;
if (PyArg_ParseTuple(args, "s#", &string, &len) == 0)
return NULL;
const char* const end = string + len;
@@ -251,7 +251,7 @@ PyDoc_STRVAR(poopt_cut_by_columns_doc, "cut_by_columns(n, string)\n\n\nreturns a
static PyObject* poopt_cut_by_columns(PyObject* self, PyObject* args)
{
const char* start;
- const int len;
+ const Py_ssize_t len;
const size_t limit;
if (PyArg_ParseTuple(args, "s#k", &start, &len, &limit) == 0)
return NULL;