From 9b51377185be5049e29c8824949fad98db25ca91 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 7 Jul 2013 20:24:03 +0200 Subject: Correctly use Py_ssize_t instead of int, fix a segfault on some architectures --- src/pooptmodule.c | 6 +++--- 1 file 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; -- cgit v1.2.3