From 6a9ca73e10c3c4e8a95101313e9c5d46cf018f86 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 7 Jan 2017 20:31:02 +0000 Subject: Types fix: first pass This pass makes variable size_t-ready, so everything works when the prototypes are fixed in skalibs. Some code uses "unsigned int *" where it should be "size_t *"; it cannot be changed now, but it's been marked with XXX. It must change at the same time as the skalibs API. --- src/libexecline/el_popenv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libexecline/el_popenv.c') diff --git a/src/libexecline/el_popenv.c b/src/libexecline/el_popenv.c index 3726506..c0089d0 100644 --- a/src/libexecline/el_popenv.c +++ b/src/libexecline/el_popenv.c @@ -1,18 +1,19 @@ /* ISC license. */ +#include #include #include #include #include #include -int el_popenv (stralloc *sa, char const *const *envp, unsigned int envlen, char const *const *list, unsigned int listlen) +int el_popenv (stralloc *sa, char const *const *envp, size_t envlen, char const *const *list, size_t listlen) { - unsigned int i = 0, salen = sa->len, count = 0 ; + size_t i = 0, salen = sa->len ; + int count = 0 ; for (; i < envlen ; i++) { - unsigned int equal, colon, n ; - unsigned int j = 0 ; + size_t equal, colon, n, j = 0 ; for (; j < listlen ; j++) if (str_start(envp[i], list[j])) break ; if (j == listlen) goto copyit ; j = str_len(list[j]) ; @@ -34,7 +35,7 @@ int el_popenv (stralloc *sa, char const *const *envp, unsigned int envlen, char copyit: if (!stralloc_catb(sa, envp[i], str_len(envp[i]) + 1)) goto err ; } - return (int)count ; + return count ; badenv : errno = EINVAL ; -- cgit v1.3.1