summaryrefslogtreecommitdiffstats
path: root/Modules/md5module.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-07-26 17:33:10 (GMT)
committerGuido van Rossum <guido@python.org>1995-07-26 17:33:10 (GMT)
commitef38b78f944156ae84e66c7e827bf1df0149f3c9 (patch)
tree98a5a1b67b904ec9296ad00e8c927e2364bcd47f /Modules/md5module.c
parentf8afdcfef0294dda5257addcc5f3e77c3fd0bd1d (diff)
downloadcpython-ef38b78f944156ae84e66c7e827bf1df0149f3c9.zip
cpython-ef38b78f944156ae84e66c7e827bf1df0149f3c9.tar.gz
cpython-ef38b78f944156ae84e66c7e827bf1df0149f3c9.tar.bz2
use newgetargs
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r--Modules/md5module.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c
index f3b86ed..51c6f6d 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -167,13 +167,10 @@ MD5_new(self, args)
{
md5object *md5p;
unsigned char *cp = NULL;
- int len;
+ int len = 0;
- if (!getargs(args, "")) {
- err_clear();
- if (!getargs(args, "s#", &cp, &len))
- return NULL;
- }
+ if (!newgetargs(args, "|s#", &cp, &len))
+ return NULL;
if ((md5p = newmd5object()) == NULL)
return NULL;
@@ -188,9 +185,9 @@ MD5_new(self, args)
/* List of functions exported by this module */
static struct methodlist md5_functions[] = {
- {"new", (method)MD5_new},
- {"md5", (method)MD5_new}, /* Backward compatibility */
- {NULL, NULL} /* Sentinel */
+ {"new", (method)MD5_new, 1},
+ {"md5", (method)MD5_new, 1}, /* Backward compatibility */
+ {NULL, NULL} /* Sentinel */
};