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-grp.c | 2 +- nis/nss_nis/nis-publickey.c | 17 ++++++++++------- nis/nss_nis/nis-pwd.c | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'nis/nss_nis') diff --git a/nis/nss_nis/nis-grp.c b/nis/nss_nis/nis-grp.c index 9b7531a68d..e85d68bdf7 100644 --- a/nis/nss_nis/nis-grp.c +++ b/nis/nss_nis/nis-grp.c @@ -227,7 +227,7 @@ _nss_nis_getgrgid_r (gid_t gid, struct group *grp, if (yp_get_default_domain (&domain)) return NSS_STATUS_UNAVAIL; - nlen = sprintf (buf, "%d", gid); + nlen = sprintf (buf, "%lu", (unsigned long int) gid); retval = yperr2nss (yp_match (domain, "group.bygid", buf, nlen, &result, &len)); 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; diff --git a/nis/nss_nis/nis-pwd.c b/nis/nss_nis/nis-pwd.c index c343d80def..4845fd1c75 100644 --- a/nis/nss_nis/nis-pwd.c +++ b/nis/nss_nis/nis-pwd.c @@ -329,7 +329,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd, if (yp_get_default_domain (&domain)) return NSS_STATUS_UNAVAIL; - nlen = sprintf (buf, "%d", uid); + nlen = sprintf (buf, "%lu", (unsigned long int) uid); retval = yperr2nss (yp_match (domain, "passwd.byuid", buf, nlen, &result, &len)); -- cgit v1.2.3