]> git.armaanb.net Git - opendoas.git/commitdiff
Fix a group of sign comparison warnings.
authorNathan Holstein <nathan.holstein@gmail.com>
Sun, 2 Aug 2015 16:19:15 +0000 (12:19 -0400)
committerNathan Holstein <nathan.holstein@gmail.com>
Wed, 5 Aug 2015 12:50:20 +0000 (08:50 -0400)
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().

doas.c

diff --git a/doas.c b/doas.c
index eda11b3e78e209a3def747aba410332f79f481c5..9862520852a4bd1be6bf285e958820368aef7d6f 100644 (file)
--- 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);