STRUCT timespec { time_t tv_sec; long tv_nsec; };
TYPEDEF int pid_t;
-TYPEDEF int id_t;
-TYPEDEF int uid_t;
-TYPEDEF int gid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF struct __pthread * pthread_t;
STRUCT timespec { time_t tv_sec; long tv_nsec; };
TYPEDEF int pid_t;
-TYPEDEF int id_t;
-TYPEDEF int uid_t;
-TYPEDEF int gid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF struct __pthread * pthread_t;
STRUCT timespec { time_t tv_sec; long tv_nsec; };
TYPEDEF int pid_t;
-TYPEDEF int id_t;
-TYPEDEF int uid_t;
-TYPEDEF int gid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF struct __pthread * pthread_t;
STRUCT timespec { time_t tv_sec; long tv_nsec; };
TYPEDEF int pid_t;
-TYPEDEF int id_t;
-TYPEDEF int uid_t;
-TYPEDEF int gid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF struct __pthread * pthread_t;
STRUCT timespec { time_t tv_sec; long tv_nsec; };
TYPEDEF int pid_t;
-TYPEDEF int id_t;
-TYPEDEF int uid_t;
-TYPEDEF int gid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF struct __pthread * pthread_t;
STRUCT timespec { time_t tv_sec; long tv_nsec; };
TYPEDEF int pid_t;
-TYPEDEF int id_t;
-TYPEDEF unsigned int uid_t;
-TYPEDEF unsigned int gid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
TYPEDEF int key_t;
TYPEDEF struct __pthread * pthread_t;
#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;
*s++ = 0; gr->gr_passwd = s;
if (!(s = strchr(s, ':'))) continue;
- *s++ = 0; gr->gr_gid = atoi(s);
- if (!(s = strchr(s, ':'))) continue;
+ *s++ = 0; gr->gr_gid = atou(&s);
+ if (*s != ':') continue;
*s++ = 0; mems = s;
break;
#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 passwd *__getpwent_a(FILE *f, struct passwd *pw, char **line, size_t *size)
{
ssize_t l;
*s++ = 0; pw->pw_passwd = s;
if (!(s = strchr(s, ':'))) continue;
- *s++ = 0; pw->pw_uid = atoi(s);
- if (!(s = strchr(s, ':'))) continue;
+ *s++ = 0; pw->pw_uid = atou(&s);
+ if (*s != ':') continue;
- *s++ = 0; pw->pw_gid = atoi(s);
- if (!(s = strchr(s, ':'))) continue;
+ *s++ = 0; pw->pw_gid = atou(&s);
+ if (*s != ':') continue;
*s++ = 0; pw->pw_gecos = s;
if (!(s = strchr(s, ':'))) continue;