commit ad270e2f81fedbcef80cecb8be155953bdf5123d
parent 18b4161e2a80d9367477194085d52c61ab6eb5b0
Author: Nathan Holstein <nathan.holstein@gmail.com>
Date: Sun, 2 Aug 2015 12:19:15 -0400
Fix a group of sign comparison warnings.
These variables are used as offsets into arrays, and are never set to -1.
This commit just propagates the usage of size_t through from arraylen().
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/doas.c b/doas.c
@@ -188,10 +188,10 @@ parseconfig(const char *filename, int checkperms)
* Copy the environment variables in safeset from oldenvp to envp.
*/
static int
-copyenvhelper(const char **oldenvp, const char **safeset, int nsafe,
+copyenvhelper(const char **oldenvp, const char **safeset, size_t nsafe,
char **envp, int ei)
{
- int i;
+ size_t i;
for (i = 0; i < nsafe; i++) {
const char **oe = oldenvp;
@@ -224,8 +224,8 @@ copyenv(const char **oldenvp, struct rule *rule)
char **envp;
const char **extra;
int ei;
- int nsafe, nbad;
- int nextras = 0;
+ size_t nsafe, nbad;
+ size_t nextras = 0;
/* if there was no envvar whitelist, pass all except badset ones */
nbad = arraylen(badset);