Don't declare variables as "unsigned char *" that are passed to
authornaddy <naddy@openbsd.org>
Fri, 15 Oct 2021 15:01:27 +0000 (15:01 +0000)
committernaddy <naddy@openbsd.org>
Fri, 15 Oct 2021 15:01:27 +0000 (15:01 +0000)
functions that take "char *" arguments.  Where such chars are
assigned to int or passed to ctype functions, explicitly cast them
to unsigned char.

For OpenBSD's clang, -Wpointer-sign has been disabled by default,
but when the parse.y code was built elsewhere, the compiler would
complain.

With help from millert@
ok benno@ deraadt@

31 files changed:
bin/chio/parse.y
sbin/dhcpleased/parse.y
sbin/iked/parse.y
sbin/ipsecctl/parse.y
sbin/pfctl/parse.y
sbin/unwind/parse.y
usr.sbin/acme-client/parse.y
usr.sbin/bgpd/parse.y
usr.sbin/dvmrpd/parse.y
usr.sbin/eigrpd/parse.y
usr.sbin/hostapd/parse.y
usr.sbin/httpd/parse.y
usr.sbin/ifstated/parse.y
usr.sbin/iscsictl/parse.y
usr.sbin/ldapd/parse.y
usr.sbin/ldomctl/parse.y
usr.sbin/ldpd/parse.y
usr.sbin/lpd/parse.y
usr.sbin/npppd/npppd/parse.y
usr.sbin/ntpd/parse.y
usr.sbin/ospf6d/parse.y
usr.sbin/ospfd/parse.y
usr.sbin/rad/parse.y
usr.sbin/radiusd/parse.y
usr.sbin/relayd/parse.y
usr.sbin/ripd/parse.y
usr.sbin/smtpd/parse.y
usr.sbin/snmpd/parse.y
usr.sbin/switchd/parse.y
usr.sbin/vmd/parse.y
usr.sbin/ypldap/parse.y

index 9e0d2ae..ae83be9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.23 2020/10/15 19:42:56 naddy Exp $ */
+/*     $OpenBSD: parse.y,v 1.24 2021/10/15 15:01:27 naddy Exp $ */
 
 /*
  * Copyright (c) 2006 Bob Beck <beck@openbsd.org>
@@ -179,9 +179,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -192,7 +192,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -201,7 +201,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -242,10 +242,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -272,8 +272,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p;
+       char     buf[8096];
+       char    *p;
        int      quotec, next, c;
        int      token;
 
@@ -353,8 +353,8 @@ yylex(void)
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 12e332f..33c2dc7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.4 2021/09/20 11:46:22 florian Exp $       */
+/*     $OpenBSD: parse.y,v 1.5 2021/10/15 15:01:27 naddy Exp $ */
 
 /*
  * Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -463,10 +463,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -502,7 +502,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -578,8 +578,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 0dbdb5a..1f3267e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.133 2021/10/12 09:27:21 tobhe Exp $       */
+/*     $OpenBSD: parse.y,v 1.134 2021/10/15 15:01:27 naddy Exp $       */
 
 /*
  * Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -1510,10 +1510,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -1549,7 +1549,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1625,8 +1625,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 3525264..6780b53 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.179 2020/12/29 19:50:03 benno Exp $       */
+/*     $OpenBSD: parse.y,v 1.180 2021/10/15 15:01:27 naddy Exp $       */
 
 /*
  * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1054,9 +1054,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -1067,7 +1067,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -1076,7 +1076,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -1116,10 +1116,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -1132,7 +1132,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -1148,8 +1148,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -1258,8 +1258,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index a10bc6f..7eb43c3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.709 2021/02/01 00:31:04 dlg Exp $ */
+/*     $OpenBSD: parse.y,v 1.710 2021/10/15 15:01:27 naddy Exp $       */
 
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -5170,8 +5170,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -5209,7 +5209,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -5309,8 +5309,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index f3efcc5..3bb5c98 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.27 2021/08/31 20:18:03 kn Exp $   */
+/*     $OpenBSD: parse.y,v 1.28 2021/10/15 15:01:27 naddy Exp $        */
 
 /*
  * Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -557,10 +557,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -596,7 +596,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -672,8 +672,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 1febcb1..e09c228 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.42 2020/09/14 16:00:17 florian Exp $ */
+/*     $OpenBSD: parse.y,v 1.43 2021/10/15 15:01:27 naddy Exp $ */
 
 /*
  * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -594,8 +594,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -633,7 +633,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -709,8 +709,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return c;
                }
index 46a5c4d..d41ae03 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.419 2021/09/01 12:39:52 claudio Exp $ */
+/*     $OpenBSD: parse.y,v 1.420 2021/10/15 15:01:27 naddy Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -3143,8 +3143,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -3182,7 +3182,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -3278,8 +3278,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index b08ec55..3fb9b94 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.39 2019/02/13 22:57:08 deraadt Exp $ */
+/*     $OpenBSD: parse.y,v 1.40 2021/10/15 15:01:27 naddy Exp $ */
 
 /*
  * Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -421,9 +421,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -434,7 +434,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -443,7 +443,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -484,10 +484,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -500,7 +500,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -516,8 +516,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -626,8 +626,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 02b0bcc..5101770 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.31 2020/12/30 18:39:57 benno Exp $ */
+/*     $OpenBSD: parse.y,v 1.32 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -760,10 +760,10 @@ findeol(void)
 static int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -799,7 +799,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -875,8 +875,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index b749e8b..564f391 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.61 2019/05/10 01:29:31 guenther Exp $     */
+/*     $OpenBSD: parse.y,v 1.62 2021/10/15 15:01:28 naddy Exp $        */
 
 /*
  * Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -1447,8 +1447,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -1486,7 +1486,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1586,8 +1586,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 0edec5a..849f659 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.125 2021/04/10 10:10:07 claudio Exp $     */
+/*     $OpenBSD: parse.y,v 1.126 2021/10/15 15:01:28 naddy Exp $       */
 
 /*
  * Copyright (c) 2020 Matthias Pressfreund <mpfr@fn.de>
@@ -1564,10 +1564,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -1603,7 +1603,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1679,8 +1679,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 6ad61ba..1594830 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.55 2019/02/13 22:57:08 deraadt Exp $      */
+/*     $OpenBSD: parse.y,v 1.56 2021/10/15 15:01:28 naddy Exp $        */
 
 /*
  * Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
@@ -415,9 +415,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -428,7 +428,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -437,7 +437,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -478,10 +478,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -494,7 +494,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -510,8 +510,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -620,8 +620,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index a75ae08..cb788d8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.18 2019/02/13 22:57:08 deraadt Exp $ */
+/*     $OpenBSD: parse.y,v 1.19 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -495,8 +495,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -534,7 +534,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -610,8 +610,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 9dbf693..5cd254d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.42 2021/10/07 11:35:30 claudio Exp $ */
+/*     $OpenBSD: parse.y,v 1.43 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 Martin Hedenfalk <martinh@openbsd.org>
@@ -598,8 +598,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[4096];
-       u_char  *p, *val;
+       char     buf[4096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -637,7 +637,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -713,8 +713,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index e5659d2..f987ab6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.23 2021/01/30 19:32:44 kn Exp $   */
+/*     $OpenBSD: parse.y,v 1.24 2021/10/15 15:01:28 naddy Exp $        */
 
 /*
  * Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org>
@@ -413,9 +413,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -426,7 +426,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -435,7 +435,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -476,10 +476,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -492,7 +492,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -508,8 +508,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p;
+       char     buf[8096];
+       char    *p;
        int      quotec, next, c;
        int      token;
 
@@ -589,8 +589,8 @@ yylex(void)
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index a20eba1..91606fb 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.71 2019/02/13 22:57:08 deraadt Exp $ */
+/*     $OpenBSD: parse.y,v 1.72 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2013, 2015, 2016 Renato Westphal <renato@openbsd.org>
@@ -1074,10 +1074,10 @@ findeol(void)
 static int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
  top:
        p = buf;
@@ -1113,7 +1113,7 @@ yylex(void)
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1189,8 +1189,8 @@ yylex(void)
                } else {
  nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index e22ddb3..9b15f1d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.7 2019/06/28 13:32:48 deraadt Exp $       */
+/*     $OpenBSD: parse.y,v 1.8 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -277,10 +277,10 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-unsigned char  *parsebuf;
-int             parseindex;
-unsigned char   pushback_buffer[MAXPUSHBACK];
-int             pushback_index = 0;
+char   *parsebuf;
+int     parseindex;
+char    pushback_buffer[MAXPUSHBACK];
+int     pushback_index = 0;
 
 int
 lgetc(int quotec)
@@ -290,7 +290,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -299,7 +299,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -340,10 +340,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -370,10 +370,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -480,8 +480,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 5a3bf06..b3126a0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.24 2019/02/27 04:52:19 denis Exp $ */
+/*     $OpenBSD: parse.y,v 1.25 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1108,9 +1108,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -1121,7 +1121,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -1130,7 +1130,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -1171,10 +1171,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -1187,7 +1187,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -1203,8 +1203,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p;
+       char     buf[8096];
+       char    *p;
        int      quotec, next, c;
        int      token;
 
@@ -1286,8 +1286,8 @@ yylex(void)
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 81d19bb..3aa8d95 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.77 2020/04/11 07:49:48 otto Exp $ */
+/*     $OpenBSD: parse.y,v 1.78 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -561,9 +561,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -574,7 +574,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -583,7 +583,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -624,10 +624,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -640,7 +640,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -656,8 +656,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p;
+       char     buf[8096];
+       char    *p;
        int      quotec, next, c;
        int      token;
 
@@ -739,8 +739,8 @@ yylex(void)
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index d49df81..d0e1c5c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.50 2020/12/29 19:44:26 benno Exp $ */
+/*     $OpenBSD: parse.y,v 1.51 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -788,8 +788,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -827,7 +827,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -903,8 +903,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index c894fe5..82f51bf 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.103 2021/01/25 06:16:38 dlg Exp $ */
+/*     $OpenBSD: parse.y,v 1.104 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -979,8 +979,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -1018,7 +1018,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1094,8 +1094,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index c7b918f..41b1f0d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.18 2021/03/01 08:05:40 jsg Exp $  */
+/*     $OpenBSD: parse.y,v 1.19 2021/10/15 15:01:28 naddy Exp $        */
 
 /*
  * Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -579,10 +579,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -618,7 +618,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -694,8 +694,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 83bb526..a85add9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.12 2019/04/01 11:05:41 yasuoka Exp $      */
+/*     $OpenBSD: parse.y,v 1.13 2021/10/15 15:01:28 naddy Exp $        */
 
 /*
  * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -450,9 +450,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -463,7 +463,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -472,7 +472,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -513,10 +513,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -529,7 +529,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -545,8 +545,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p;
+       char     buf[8096];
+       char    *p;
        int      quotec, next, c;
        int      token;
 
@@ -628,8 +628,8 @@ yylex(void)
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 5f7513e..22beb85 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.252 2021/01/17 15:17:13 rob Exp $ */
+/*     $OpenBSD: parse.y,v 1.253 2021/10/15 15:01:28 naddy Exp $       */
 
 /*
  * Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -2631,8 +2631,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -2670,7 +2670,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -2746,8 +2746,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 82170e4..220cf53 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.47 2019/05/10 01:29:31 guenther Exp $ */
+/*     $OpenBSD: parse.y,v 1.48 2021/10/15 15:01:28 naddy Exp $ */
 
 /*
  * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -456,9 +456,9 @@ lookup(char *s)
 
 #define MAXPUSHBACK    128
 
-u_char *parsebuf;
+char   *parsebuf;
 int     parseindex;
-u_char  pushback_buffer[MAXPUSHBACK];
+char    pushback_buffer[MAXPUSHBACK];
 int     pushback_index = 0;
 
 int
@@ -469,7 +469,7 @@ lgetc(int quotec)
        if (parsebuf) {
                /* Read character from the parsebuffer instead of input. */
                if (parseindex >= 0) {
-                       c = parsebuf[parseindex++];
+                       c = (unsigned char)parsebuf[parseindex++];
                        if (c != '\0')
                                return (c);
                        parsebuf = NULL;
@@ -478,7 +478,7 @@ lgetc(int quotec)
        }
 
        if (pushback_index)
-               return (pushback_buffer[--pushback_index]);
+               return ((unsigned char)pushback_buffer[--pushback_index]);
 
        if (quotec) {
                if ((c = getc(file->stream)) == EOF) {
@@ -519,10 +519,10 @@ lungetc(int c)
                if (parseindex >= 0)
                        return (c);
        }
-       if (pushback_index < MAXPUSHBACK-1)
-               return (pushback_buffer[pushback_index++] = c);
-       else
+       if (pushback_index + 1 >= MAXPUSHBACK)
                return (EOF);
+       pushback_buffer[pushback_index++] = c;
+       return (c);
 }
 
 int
@@ -535,7 +535,7 @@ findeol(void)
        /* skip to either EOF or the first real EOL */
        while (1) {
                if (pushback_index)
-                       c = pushback_buffer[--pushback_index];
+                       c = (unsigned char)pushback_buffer[--pushback_index];
                else
                        c = lgetc(0);
                if (c == '\n') {
@@ -551,8 +551,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -661,8 +661,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 832f4f2..7de52a1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.289 2021/06/14 17:58:15 eric Exp $        */
+/*     $OpenBSD: parse.y,v 1.290 2021/10/15 15:01:29 naddy Exp $       */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -2859,10 +2859,10 @@ findeol(void)
 int
 yylex(void)
 {
-       unsigned char    buf[8096];
-       unsigned char   *p, *val;
-       int              quotec, next, c;
-       int              token;
+       char     buf[8096];
+       char    *p, *val;
+       int      quotec, next, c;
+       int      token;
 
 top:
        p = buf;
@@ -2898,7 +2898,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -2974,8 +2974,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index c8be3b4..c19edf8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.69 2021/10/09 18:43:50 deraadt Exp $      */
+/*     $OpenBSD: parse.y,v 1.70 2021/10/15 15:01:29 naddy Exp $        */
 
 /*
  * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -1166,8 +1166,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -1205,7 +1205,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1281,8 +1281,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index a1e2c79..a77d3fd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.15 2019/02/13 22:57:08 deraadt Exp $      */
+/*     $OpenBSD: parse.y,v 1.16 2021/10/15 15:01:29 naddy Exp $        */
 
 /*
  * Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
@@ -419,8 +419,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -458,7 +458,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -534,8 +534,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index 896e5c1..ebebbf2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.58 2021/06/16 16:55:02 dv Exp $   */
+/*     $OpenBSD: parse.y,v 1.59 2021/10/15 15:01:29 naddy Exp $        */
 
 /*
  * Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
@@ -930,8 +930,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -969,7 +969,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -1045,8 +1045,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }
index b5aa523..32ca3da 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.33 2019/02/13 22:57:08 deraadt Exp $      */
+/*     $OpenBSD: parse.y,v 1.34 2021/10/15 15:01:29 naddy Exp $        */
 
 /*
  * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -605,8 +605,8 @@ findeol(void)
 int
 yylex(void)
 {
-       u_char   buf[8096];
-       u_char  *p, *val;
+       char     buf[8096];
+       char    *p, *val;
        int      quotec, next, c;
        int      token;
 
@@ -644,7 +644,7 @@ top:
                p = val + strlen(val) - 1;
                lungetc(DONE_EXPAND);
                while (p >= val) {
-                       lungetc(*p);
+                       lungetc((unsigned char)*p);
                        p--;
                }
                lungetc(START_EXPAND);
@@ -720,8 +720,8 @@ top:
                } else {
 nodigits:
                        while (p > buf + 1)
-                               lungetc(*--p);
-                       c = *--p;
+                               lungetc((unsigned char)*--p);
+                       c = (unsigned char)*--p;
                        if (c == '-')
                                return (c);
                }