Use getargs() function.

This commit is contained in:
Guido van Rossum 1992-01-27 16:51:30 +00:00
parent 550fbcc2aa
commit ef0a00ec0c
3 changed files with 47 additions and 62 deletions

View file

@ -76,11 +76,11 @@ static object *pwd_getpwuid(self, args)
static object *pwd_getpwnam(self, args)
object *self, *args;
{
object *name;
char *name;
struct passwd *p;
if (!getstrarg(args, &name))
return NULL;
if ((p = getpwnam(getstringvalue(name))) == NULL) {
if ((p = getpwnam(name)) == NULL) {
err_setstr(KeyError, "getpwnam(): name not found");
return NULL;
}
@ -176,11 +176,11 @@ static object *grp_getgrgid(self, args)
static object *grp_getgrnam(self, args)
object *self, *args;
{
object *name;
char *name;
struct group *p;
if (!getstrarg(args, &name))
return NULL;
if ((p = getgrnam(getstringvalue(name))) == NULL) {
if ((p = getgrnam(name)) == NULL) {
err_setstr(KeyError, "getgrnam(): name not found");
return NULL;
}