diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-11-27 03:47:06 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-11-27 03:47:06 +0000 |
commit | 8e9b2075ba1d6ce2ab82c2eb2547e2c2ef3ecca8 (patch) | |
tree | de7fba86c989c6f7df1d6d7bac078813d0855fa3 /nis/nss_nis/nis-publickey.c | |
parent | f4efd06825ba5fec62662be611d94335eff4f8f7 (diff) | |
download | glibc-8e9b2075ba1d6ce2ab82c2eb2547e2c2ef3ecca8.tar glibc-8e9b2075ba1d6ce2ab82c2eb2547e2c2ef3ecca8.tar.gz glibc-8e9b2075ba1d6ce2ab82c2eb2547e2c2ef3ecca8.tar.bz2 glibc-8e9b2075ba1d6ce2ab82c2eb2547e2c2ef3ecca8.zip |
Update.
2001-11-21 Bruno Haible <bruno@clisp.org>
* charmaps/ISO-8859-16: Swap 0xa5 and 0xab entries.
Diffstat (limited to 'nis/nss_nis/nis-publickey.c')
-rw-r--r-- | nis/nss_nis/nis-publickey.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/nis/nss_nis/nis-publickey.c b/nis/nss_nis/nis-publickey.c index ecdf80f66b..f686054426 100644 --- a/nis/nss_nis/nis-publickey.c +++ b/nis/nss_nis/nis-publickey.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996. @@ -143,7 +143,7 @@ static enum nss_status parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp, gid_t *gidlist) { - char *p; + char *p, *ep; int gidlen; if (!s || !isdigit (*s)) @@ -153,7 +153,7 @@ parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp, } /* Fetch the uid */ - *uidp = (atoi (s)); + *uidp = strtoul (s, NULL, 10); if (*uidp == 0) { @@ -175,14 +175,17 @@ parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp, return NSS_STATUS_NOTFOUND; } - *gidp = (atoi (p)); + *gidp = strtoul (p, &ep, 10); gidlen = 0; - while ((p = strchr (p, ',')) != NULL) + /* After strtoul() ep should point to the first invalid character. + This is the marker "," we search for the next value. */ + while (ep != NULL && *ep == ',') { - p++; - gidlist[gidlen++] = atoi (p); + ep++; + p = ep; + gidlist[gidlen++] = strtoul (p, &ep, 10); } *gidlenp = gidlen; |