Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef38b78

Browse files
committed
use newgetargs
1 parent f8afdcf commit ef38b78

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

Modules/md5module.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,10 @@ MD5_new(self, args)
167167
{
168168
md5object *md5p;
169169
unsigned char *cp = NULL;
170-
int len;
170+
int len = 0;
171171

172-
if (!getargs(args, "")) {
173-
err_clear();
174-
if (!getargs(args, "s#", &cp, &len))
175-
return NULL;
176-
}
172+
if (!newgetargs(args, "|s#", &cp, &len))
173+
return NULL;
177174

178175
if ((md5p = newmd5object()) == NULL)
179176
return NULL;
@@ -188,9 +185,9 @@ MD5_new(self, args)
188185
/* List of functions exported by this module */
189186

190187
static struct methodlist md5_functions[] = {
191-
{"new", (method)MD5_new},
192-
{"md5", (method)MD5_new}, /* Backward compatibility */
193-
{NULL, NULL} /* Sentinel */
188+
{"new", (method)MD5_new, 1},
189+
{"md5", (method)MD5_new, 1}, /* Backward compatibility */
190+
{NULL, NULL} /* Sentinel */
194191
};
195192

196193

0 commit comments

Comments
 (0)