summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd
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/ldpd
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/ldpd')
-rw-r--r--usr.sbin/ldpd/parse.y16
1 files changed, 8 insertions, 8 deletions
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);
}