summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2021-10-15 15:01:30 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2021-10-15 15:01:30 +0000
commit1962f7440266854ff99ccbcccdb8901d4a390f3b (patch)
treea370187304af1b3e92149ae0b83ab036b229cba8 /usr.sbin
parent419d75fa85d117d2faff0336cca5f20917cc3bfb (diff)
Don't declare variables as "unsigned char *" that are passed to
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/acme-client/parse.y12
-rw-r--r--usr.sbin/bgpd/parse.y12
-rw-r--r--usr.sbin/dvmrpd/parse.y26
-rw-r--r--usr.sbin/eigrpd/parse.y16
-rw-r--r--usr.sbin/hostapd/parse.y12
-rw-r--r--usr.sbin/httpd/parse.y16
-rw-r--r--usr.sbin/ifstated/parse.y26
-rw-r--r--usr.sbin/iscsictl/parse.y12
-rw-r--r--usr.sbin/ldapd/parse.y12
-rw-r--r--usr.sbin/ldomctl/parse.y26
-rw-r--r--usr.sbin/ldpd/parse.y16
-rw-r--r--usr.sbin/lpd/parse.y32
-rw-r--r--usr.sbin/npppd/npppd/parse.y26
-rw-r--r--usr.sbin/ntpd/parse.y26
-rw-r--r--usr.sbin/ospf6d/parse.y12
-rw-r--r--usr.sbin/ospfd/parse.y12
-rw-r--r--usr.sbin/rad/parse.y16
-rw-r--r--usr.sbin/radiusd/parse.y26
-rw-r--r--usr.sbin/relayd/parse.y12
-rw-r--r--usr.sbin/ripd/parse.y26
-rw-r--r--usr.sbin/smtpd/parse.y16
-rw-r--r--usr.sbin/snmpd/parse.y12
-rw-r--r--usr.sbin/switchd/parse.y12
-rw-r--r--usr.sbin/vmd/parse.y12
-rw-r--r--usr.sbin/ypldap/parse.y12
25 files changed, 219 insertions, 219 deletions
diff --git a/usr.sbin/acme-client/parse.y b/usr.sbin/acme-client/parse.y
index 1febcb10a3a..e09c2283ad4 100644
--- a/usr.sbin/acme-client/parse.y
+++ b/usr.sbin/acme-client/parse.y
@@ -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;
}
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 46a5c4d9670..d41ae03bfe2 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/dvmrpd/parse.y b/usr.sbin/dvmrpd/parse.y
index b08ec559f6c..3fb9b94c3a3 100644
--- a/usr.sbin/dvmrpd/parse.y
+++ b/usr.sbin/dvmrpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/eigrpd/parse.y b/usr.sbin/eigrpd/parse.y
index 02b0bcc31f2..5101770e7ad 100644
--- a/usr.sbin/eigrpd/parse.y
+++ b/usr.sbin/eigrpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y
index b749e8bc830..564f39190ef 100644
--- a/usr.sbin/hostapd/parse.y
+++ b/usr.sbin/hostapd/parse.y
@@ -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);
}
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index 0edec5acc9f..849f659f9fa 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/ifstated/parse.y b/usr.sbin/ifstated/parse.y
index 6ad61baaec0..15948300d0f 100644
--- a/usr.sbin/ifstated/parse.y
+++ b/usr.sbin/ifstated/parse.y
@@ -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);
}
diff --git a/usr.sbin/iscsictl/parse.y b/usr.sbin/iscsictl/parse.y
index a75ae08ffd8..cb788d88de7 100644
--- a/usr.sbin/iscsictl/parse.y
+++ b/usr.sbin/iscsictl/parse.y
@@ -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);
}
diff --git a/usr.sbin/ldapd/parse.y b/usr.sbin/ldapd/parse.y
index 9dbf6930abb..5cd254d74f3 100644
--- a/usr.sbin/ldapd/parse.y
+++ b/usr.sbin/ldapd/parse.y
@@ -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);
}
diff --git a/usr.sbin/ldomctl/parse.y b/usr.sbin/ldomctl/parse.y
index e5659d215db..f987ab60042 100644
--- a/usr.sbin/ldomctl/parse.y
+++ b/usr.sbin/ldomctl/parse.y
@@ -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);
}
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y
index a20eba16c15..91606fb6c10 100644
--- a/usr.sbin/ldpd/parse.y
+++ b/usr.sbin/ldpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/lpd/parse.y b/usr.sbin/lpd/parse.y
index e22ddb3d9ee..9b15f1db177 100644
--- a/usr.sbin/lpd/parse.y
+++ b/usr.sbin/lpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/npppd/npppd/parse.y b/usr.sbin/npppd/npppd/parse.y
index 5a3bf064869..b3126a0595d 100644
--- a/usr.sbin/npppd/npppd/parse.y
+++ b/usr.sbin/npppd/npppd/parse.y
@@ -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);
}
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y
index 81d19bbff43..3aa8d95a9af 100644
--- a/usr.sbin/ntpd/parse.y
+++ b/usr.sbin/ntpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/ospf6d/parse.y b/usr.sbin/ospf6d/parse.y
index d49df81a81e..d0e1c5c7a94 100644
--- a/usr.sbin/ospf6d/parse.y
+++ b/usr.sbin/ospf6d/parse.y
@@ -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);
}
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index c894fe5678d..82f51bfdd44 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -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);
}
diff --git a/usr.sbin/rad/parse.y b/usr.sbin/rad/parse.y
index c7b918f4086..41b1f0da133 100644
--- a/usr.sbin/rad/parse.y
+++ b/usr.sbin/rad/parse.y
@@ -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);
}
diff --git a/usr.sbin/radiusd/parse.y b/usr.sbin/radiusd/parse.y
index 83bb52674ba..a85add90e3f 100644
--- a/usr.sbin/radiusd/parse.y
+++ b/usr.sbin/radiusd/parse.y
@@ -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);
}
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index 5f7513e788d..22beb857229 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -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);
}
diff --git a/usr.sbin/ripd/parse.y b/usr.sbin/ripd/parse.y
index 82170e45a5d..220cf53d8e9 100644
--- a/usr.sbin/ripd/parse.y
+++ b/usr.sbin/ripd/parse.y
@@ -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);
}
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y
index 832f4f2aec9..7de52a1c568 100644
--- a/usr.sbin/smtpd/parse.y
+++ b/usr.sbin/smtpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/snmpd/parse.y b/usr.sbin/snmpd/parse.y
index c8be3b434a3..c19edf81cff 100644
--- a/usr.sbin/snmpd/parse.y
+++ b/usr.sbin/snmpd/parse.y
@@ -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);
}
diff --git a/usr.sbin/switchd/parse.y b/usr.sbin/switchd/parse.y
index a1e2c79ba78..a77d3fd2da3 100644
--- a/usr.sbin/switchd/parse.y
+++ b/usr.sbin/switchd/parse.y
@@ -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);
}
diff --git a/usr.sbin/vmd/parse.y b/usr.sbin/vmd/parse.y
index 896e5c11b04..ebebbf24750 100644
--- a/usr.sbin/vmd/parse.y
+++ b/usr.sbin/vmd/parse.y
@@ -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);
}
diff --git a/usr.sbin/ypldap/parse.y b/usr.sbin/ypldap/parse.y
index b5aa523abae..32ca3da3e97 100644
--- a/usr.sbin/ypldap/parse.y
+++ b/usr.sbin/ypldap/parse.y
@@ -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);
}