=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/id/id.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/usr.bin/id/id.c 2004/05/31 15:48:26 1.15 +++ src/usr.bin/id/id.c 2004/07/19 09:22:17 1.16 @@ -1,4 +1,4 @@ -/* $OpenBSD: id.c,v 1.15 2004/05/31 15:48:26 pedro Exp $ */ +/* $OpenBSD: id.c,v 1.16 2004/07/19 09:22:17 pvalchev Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #ifndef lint /*static char sccsid[] = "@(#)id.c 8.3 (Berkeley) 4/28/95";*/ -static char rcsid[] = "$OpenBSD: id.c,v 1.15 2004/05/31 15:48:26 pedro Exp $"; +static char rcsid[] = "$OpenBSD: id.c,v 1.16 2004/07/19 09:22:17 pvalchev Exp $"; #endif /* not lint */ #include @@ -295,7 +295,7 @@ { struct passwd *pw; uid_t uid; - char *ep; + const char *errstr; /* * Translate user argument into a pw pointer. First, try to @@ -303,8 +303,8 @@ */ if ((pw = getpwnam(u))) return(pw); - uid = strtoul(u, &ep, 10); - if (*u && !*ep && (pw = getpwuid(uid))) + uid = strtonum(u, 0, UID_MAX, &errstr); + if (!errstr && (pw = getpwuid(uid))) return(pw); errx(1, "%s: No such user", u); /* NOTREACHED */