From: Victor Stinner Date: Tue, 25 Jun 2013 21:13:47 +0000 (+0200) Subject: Fix os.confstr(): the result type of the C function is size_t, not int X-Git-Tag: v3.4.0a1~382 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd3a6a5533bed5f9d1250856e4aa9edd70ec9ef2;p=thirdparty%2FPython%2Fcpython.git Fix os.confstr(): the result type of the C function is size_t, not int --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index fd4628c76379..226a4d510b12 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -9140,7 +9140,7 @@ posix_confstr(PyObject *self, PyObject *args) PyObject *result = NULL; int name; char buffer[255]; - int len; + size_t len; if (!PyArg_ParseTuple(args, "O&:confstr", conv_confstr_confname, &name)) return NULL; @@ -9157,7 +9157,7 @@ posix_confstr(PyObject *self, PyObject *args) } } - if ((unsigned int)len >= sizeof(buffer)) { + if (len >= sizeof(buffer)) { char *buf = PyMem_Malloc(len); if (buf == NULL) return PyErr_NoMemory();