From 8e9b2075ba1d6ce2ab82c2eb2547e2c2ef3ecca8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 27 Nov 2001 03:47:06 +0000 Subject: Update. 2001-11-21 Bruno Haible * charmaps/ISO-8859-16: Swap 0xa5 and 0xab entries. --- nis/nss_nis/nis-publickey.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'nis/nss_nis/nis-publickey.c') 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 , 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; -- cgit v1.2.3