summaryrefslogtreecommitdiffstats
path: root/Modules/zlibmodule.c
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2005-11-22 15:32:28 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2005-11-22 15:32:28 (GMT)
commitbb7e800506c5d27c9105bc47b09ac368dddb4492 (patch)
tree56a9dc2b46da91e29afce8ce51d208bc73864427 /Modules/zlibmodule.c
parentb2a739d19b53af948ffe4bc1d4cd03e6ab70928c (diff)
downloadcpython-bb7e800506c5d27c9105bc47b09ac368dddb4492.zip
cpython-bb7e800506c5d27c9105bc47b09ac368dddb4492.tar.gz
cpython-bb7e800506c5d27c9105bc47b09ac368dddb4492.tar.bz2
[Patch #1350573] zlib.crc32 doesn't handle 0xffffffff seed. Add tests and bugfix. Bug reported by John Schmidt; bugfix by Danny Yoo.
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r--Modules/zlibmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index c3238a0..a598ae3 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -778,7 +778,7 @@ PyZlib_adler32(PyObject *self, PyObject *args)
Byte *buf;
int len;
- if (!PyArg_ParseTuple(args, "s#|l:adler32", &buf, &len, &adler32val))
+ if (!PyArg_ParseTuple(args, "s#|k:adler32", &buf, &len, &adler32val))
return NULL;
adler32val = adler32(adler32val, buf, len);
return PyInt_FromLong(adler32val);
@@ -796,7 +796,7 @@ PyZlib_crc32(PyObject *self, PyObject *args)
uLong crc32val = crc32(0L, Z_NULL, 0);
Byte *buf;
int len;
- if (!PyArg_ParseTuple(args, "s#|l:crc32", &buf, &len, &crc32val))
+ if (!PyArg_ParseTuple(args, "s#|k:crc32", &buf, &len, &crc32val))
return NULL;
crc32val = crc32(crc32val, buf, len);
return PyInt_FromLong(crc32val);