[uClibc-cvs] uClibc/libc/pwd_grp pwd_grp.c,1.2,1.3
Manuel Novoa III
mjn3 at uclibc.org
Thu Nov 6 22:01:08 UTC 2003
Update of /var/cvs/uClibc/libc/pwd_grp
In directory winder:/tmp/cvs-serv6667
Modified Files:
pwd_grp.c
Log Message:
Sigh... I wasn't checking if the gid field in a group line actually
contained a digit. Also adjust a comment.
Index: pwd_grp.c
===================================================================
RCS file: /var/cvs/uClibc/libc/pwd_grp/pwd_grp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pwd_grp.c 6 Nov 2003 21:13:03 -0000 1.2
+++ pwd_grp.c 6 Nov 2003 22:01:03 -0000 1.3
@@ -966,7 +966,11 @@
/* NOTE: glibc difference - glibc allows omission of the
* trailing colon when there is no member list. We treat
* this as an error. */
- if (*endptr != ':') {
+
+ /* Make sure we had at least one digit, and that the
+ * failing char is the next field seperator ':'. See
+ * glibc difference note above. */
+ if ((endptr == line) || (*endptr != ':')) {
break;
}
@@ -1104,8 +1108,6 @@
* and for which the parser function succeeds.
*
* Returns 0 on success and ENOENT for end-of-file (glibc concession).
- * On error, it both sets errno to ERANGE and returns ERANGE.
- * (seems to be glibc behavior.)
*/
int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
More information about the uClibc-cvs
mailing list