]> git.armaanb.net Git - opendoas.git/commitdiff
Fix a sign comparison warning.
authorNathan Holstein <nathan.holstein@gmail.com>
Sun, 2 Aug 2015 16:13:47 +0000 (12:13 -0400)
committerNathan Holstein <nathan.holstein@gmail.com>
Wed, 5 Aug 2015 12:50:06 +0000 (08:50 -0400)
The 'i' variable was only used in this loop, so move it locally and
change its type to unsigned.

parse.y

diff --git a/parse.y b/parse.y
index 7454f85f0a75bb6e0d2243fa0cb712e6fe7f2c2a..7b1b45ac84e8249eee46f8caf2e30191432648dc 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -203,7 +203,7 @@ int
 yylex(void)
 {
        char buf[1024], *ebuf, *p, *str;
-       int i, c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+       int c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
 
        p = buf;
        ebuf = buf + sizeof(buf);
@@ -306,6 +306,7 @@ eow:
                        goto repeat;
        }
        if (!nonkw) {
+               unsigned i;
                for (i = 0; i < sizeof(keywords) / sizeof(keywords[0]); i++) {
                        if (strcmp(buf, keywords[i].word) == 0)
                                return keywords[i].token;