summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-03-07 12:08:51 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-03-07 12:08:51 (GMT)
commit725507b52ec40ab49ad87596fff7434322b9b5b1 (patch)
tree5b16b79a6810a7c2683db27ee9d34b10b270ae86 /Modules/posixmodule.c
parent8eb8a829c1e4535be9d98b70875d5193f6b94737 (diff)
downloadcpython-725507b52ec40ab49ad87596fff7434322b9b5b1.zip
cpython-725507b52ec40ab49ad87596fff7434322b9b5b1.tar.gz
cpython-725507b52ec40ab49ad87596fff7434322b9b5b1.tar.bz2
Change int to Py_ssize_t in several places.
Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 6949c90..ba1e6c0 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2317,9 +2317,9 @@ posix__exit(PyObject *self, PyObject *args)
#if defined(HAVE_EXECV) || defined(HAVE_SPAWNV)
static void
-free_string_array(char **array, int count)
+free_string_array(char **array, Py_ssize_t count)
{
- int i;
+ Py_ssize_t i;
for (i = 0; i < count; i++)
PyMem_Free(array[i]);
PyMem_DEL(array);
@@ -2341,7 +2341,7 @@ posix_execv(PyObject *self, PyObject *args)
char *path;
PyObject *argv;
char **argvlist;
- int i, argc;
+ Py_ssize_t i, argc;
PyObject *(*getitem)(PyObject *, Py_ssize_t);
/* execv has two arguments: (path, argv), where
@@ -2410,7 +2410,7 @@ posix_execve(PyObject *self, PyObject *args)
char **argvlist;
char **envlist;
PyObject *key, *val, *keys=NULL, *vals=NULL;
- int i, pos, argc, envc;
+ Py_ssize_t i, pos, argc, envc;
PyObject *(*getitem)(PyObject *, Py_ssize_t);
int lastarg = 0;