* libmisc/getgr_nam_gid.c: Added support for NULL argument.

* libmisc/chowntty.c: Reuse getgr_nam_gid(), and get rid of atol().
This commit is contained in:
nekral-guest
2009-04-11 16:23:21 +00:00
parent e27f4a91b9
commit 60a7cc9d7c
3 changed files with 14 additions and 13 deletions

View File

@@ -49,6 +49,10 @@ extern struct group *getgr_nam_gid (const char *grname)
long long int gid;
char *endptr;
if (NULL == grname) {
return NULL;
}
errno = 0;
gid = strtoll (grname, &endptr, 10);
if ( ('\0' != *grname)