summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-06-25 21:13:47 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-06-25 21:13:47 (GMT)
commitdd3a6a5533bed5f9d1250856e4aa9edd70ec9ef2 (patch)
tree13e782bfd0255704348863cd24b1615f7475af68 /Modules/posixmodule.c
parent93037498d1f61f31e5b52d2f8d4aa437a26bc14e (diff)
downloadcpython-dd3a6a5533bed5f9d1250856e4aa9edd70ec9ef2.zip
cpython-dd3a6a5533bed5f9d1250856e4aa9edd70ec9ef2.tar.gz
cpython-dd3a6a5533bed5f9d1250856e4aa9edd70ec9ef2.tar.bz2
Fix os.confstr(): the result type of the C function is size_t, not int
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index fd4628c..226a4d5 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();