diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-02-15 17:27:45 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-02-15 17:27:45 (GMT) |
commit | 18e165558b24d29e7e0ca501842b9236589b012a (patch) | |
tree | 841678b5dc1aff3aa48701fee33a6ba7be00a72b /Modules/zipimport.c | |
parent | 44829297348d9121a03fc7df2fac557b583cc7fa (diff) | |
download | cpython-18e165558b24d29e7e0ca501842b9236589b012a.zip cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.gz cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.bz2 |
Merge ssize_t branch.
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r-- | Modules/zipimport.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 937b0f7..be141d0 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -249,6 +249,7 @@ make_filename(char *prefix, char *name, char *path) *p = SEP; } len += strlen(name); + assert(len < INT_MAX); return (int)len; } @@ -808,7 +809,8 @@ get_data(char *archive, PyObject *toc_entry) PyObject *raw_data, *data = NULL, *decompress; char *buf; FILE *fp; - int err, bytes_read = 0; + int err; + Py_ssize_t bytes_read = 0; long l; char *datapath; long compress, data_size, file_size, file_offset; @@ -1024,7 +1026,7 @@ get_mtime_of_source(ZipImporter *self, char *path) { PyObject *toc_entry; time_t mtime = 0; - int lastchar = strlen(path) - 1; + Py_ssize_t lastchar = strlen(path) - 1; char savechar = path[lastchar]; path[lastchar] = '\0'; /* strip 'c' or 'o' from *.py[co] */ toc_entry = PyDict_GetItemString(self->files, path); |