From 08f6ba1906d01c4a24fa700d568400f71bcf9611 Mon Sep 17 00:00:00 2001 From: naddy Date: Fri, 15 Oct 2021 15:01:27 +0000 Subject: [PATCH] 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@ --- bin/chio/parse.y | 24 ++++++++++++------------ sbin/dhcpleased/parse.y | 16 ++++++++-------- sbin/iked/parse.y | 16 ++++++++-------- sbin/ipsecctl/parse.y | 26 +++++++++++++------------- sbin/pfctl/parse.y | 12 ++++++------ sbin/unwind/parse.y | 16 ++++++++-------- usr.sbin/acme-client/parse.y | 12 ++++++------ usr.sbin/bgpd/parse.y | 12 ++++++------ usr.sbin/dvmrpd/parse.y | 26 +++++++++++++------------- usr.sbin/eigrpd/parse.y | 16 ++++++++-------- usr.sbin/hostapd/parse.y | 12 ++++++------ usr.sbin/httpd/parse.y | 16 ++++++++-------- usr.sbin/ifstated/parse.y | 26 +++++++++++++------------- usr.sbin/iscsictl/parse.y | 12 ++++++------ usr.sbin/ldapd/parse.y | 12 ++++++------ usr.sbin/ldomctl/parse.y | 26 +++++++++++++------------- usr.sbin/ldpd/parse.y | 16 ++++++++-------- usr.sbin/lpd/parse.y | 32 ++++++++++++++++---------------- usr.sbin/npppd/npppd/parse.y | 26 +++++++++++++------------- usr.sbin/ntpd/parse.y | 26 +++++++++++++------------- usr.sbin/ospf6d/parse.y | 12 ++++++------ usr.sbin/ospfd/parse.y | 12 ++++++------ usr.sbin/rad/parse.y | 16 ++++++++-------- usr.sbin/radiusd/parse.y | 26 +++++++++++++------------- usr.sbin/relayd/parse.y | 12 ++++++------ usr.sbin/ripd/parse.y | 26 +++++++++++++------------- usr.sbin/smtpd/parse.y | 16 ++++++++-------- usr.sbin/snmpd/parse.y | 12 ++++++------ usr.sbin/switchd/parse.y | 12 ++++++------ usr.sbin/vmd/parse.y | 12 ++++++------ usr.sbin/ypldap/parse.y | 12 ++++++------ 31 files changed, 274 insertions(+), 274 deletions(-) diff --git a/bin/chio/parse.y b/bin/chio/parse.y index 9e0d2ae2ab9..ae83be9a6d9 100644 --- a/bin/chio/parse.y +++ b/bin/chio/parse.y @@ -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 @@ -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); } diff --git a/sbin/dhcpleased/parse.y b/sbin/dhcpleased/parse.y index 12e332f04d9..33c2dc7f335 100644 --- a/sbin/dhcpleased/parse.y +++ b/sbin/dhcpleased/parse.y @@ -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 @@ -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); } diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index 0dbdb5a5e85..1f3267ebc54 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -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 @@ -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); } diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y index 352526452b0..6780b5385ff 100644 --- a/sbin/ipsecctl/parse.y +++ b/sbin/ipsecctl/parse.y @@ -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 @@ -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); } diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index a10bc6f315c..7eb43c38e87 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -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); } diff --git a/sbin/unwind/parse.y b/sbin/unwind/parse.y index f3efcc5689e..3bb5c98af18 100644 --- a/sbin/unwind/parse.y +++ b/sbin/unwind/parse.y @@ -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 @@ -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); } 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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); } -- 2.20.1