summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/getpwent.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/getpwent.c')
-rw-r--r--lib/libc/gen/getpwent.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 6546f587..8617ecc 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -1607,10 +1607,9 @@ compat_redispatch(struct compat_state *st, enum nss_lookup_type how,
{ NULL, NULL, NULL }
};
void *discard;
- int rv, e;
- unsigned int i;
+ int e, i, rv;
- for (i = 0; i < sizeof(dtab)/sizeof(dtab[0]) - 1; i++)
+ for (i = 0; i < (int)(nitems(dtab) - 1); i++)
dtab[i].mdata = (void *)lookup_how;
more:
pwd_init(pwd);
@@ -1703,9 +1702,8 @@ compat_setpwent(void *retval, void *mdata, va_list ap)
int rv, stayopen;
#define set_setent(x, y) do { \
- unsigned int i; \
- \
- for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \
+ int i; \
+ for (i = 0; i < (int)(nitems(x) - 1); i++) \
x[i].mdata = (void *)y; \
} while (0)
OpenPOWER on IntegriCloud