opendoas

A portable version of the OpenBSD `doas` command
git clone https://pi.duncano.de/git/opendoas.git
Log | Files | Refs | README | LICENSE

commit 18b4161e2a80d9367477194085d52c61ab6eb5b0
parent e1f898280487cd0972021b8e6a937f9597cb6ce9
Author: Nathan Holstein <nathan.holstein@gmail.com>
Date:   Sun,  2 Aug 2015 12:13:47 -0400

Fix a sign comparison warning.

The 'i' variable was only used in this loop, so move it locally and
change its type to unsigned.

Diffstat:
parse.y | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 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;