projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change uid_t, gid_t, and id_t to unsigned types
[musl]
/
src
/
passwd
/
getgrent_a.c
diff --git
a/src/passwd/getgrent_a.c
b/src/passwd/getgrent_a.c
index
780560d
..
2cb8521
100644
(file)
--- a/
src/passwd/getgrent_a.c
+++ b/
src/passwd/getgrent_a.c
@@
-1,6
+1,13
@@
#include "pwf.h"
#include <pthread.h>
#include "pwf.h"
#include <pthread.h>
+static unsigned atou(char **s)
+{
+ unsigned x;
+ for (x=0; **s-'0'<10U; ++*s) x=10*x+(**s-'0');
+ return x;
+}
+
struct group *__getgrent_a(FILE *f, struct group *gr, char **line, size_t *size, char ***mem, size_t *nmem)
{
ssize_t l;
struct group *__getgrent_a(FILE *f, struct group *gr, char **line, size_t *size, char ***mem, size_t *nmem)
{
ssize_t l;
@@
-24,8
+31,8
@@
struct group *__getgrent_a(FILE *f, struct group *gr, char **line, size_t *size,
*s++ = 0; gr->gr_passwd = s;
if (!(s = strchr(s, ':'))) continue;
*s++ = 0; gr->gr_passwd = s;
if (!(s = strchr(s, ':'))) continue;
- *s++ = 0; gr->gr_gid = ato
i(
s);
- if (
!(s = strchr(s, ':'))
) continue;
+ *s++ = 0; gr->gr_gid = ato
u(&
s);
+ if (
*s != ':'
) continue;
*s++ = 0; mems = s;
break;
*s++ = 0; mems = s;
break;