summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-02-13 22:57:07 +0000
committerderaadt <deraadt@openbsd.org>2019-02-13 22:57:07 +0000
commit915c3f33d30399505d94a06fc5123e4bbdc9531f (patch)
treeee3b909e9fc1fb29e610142968bc73a972634746 /usr.sbin/ldpd
parentsync (diff)
downloadwireguard-openbsd-915c3f33d30399505d94a06fc5123e4bbdc9531f.tar.xz
wireguard-openbsd-915c3f33d30399505d94a06fc5123e4bbdc9531f.zip
(unsigned) means (unsigned int) which on ptrdiff_t or size_t or other
larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno
Diffstat (limited to 'usr.sbin/ldpd')
-rw-r--r--usr.sbin/ldpd/parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y
index 733703a4d99..a20eba16c15 100644
--- a/usr.sbin/ldpd/parse.y
+++ b/usr.sbin/ldpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.70 2019/01/23 08:43:45 dlg Exp $ */
+/* $OpenBSD: parse.y,v 1.71 2019/02/13 22:57:08 deraadt Exp $ */
/*
* Copyright (c) 2013, 2015, 2016 Renato Westphal <renato@openbsd.org>
@@ -1166,7 +1166,7 @@ yylex(void)
if (c == '-' || isdigit(c)) {
do {
*p++ = c;
- if ((unsigned)(p-buf) >= sizeof(buf)) {
+ if ((size_t)(p-buf) >= sizeof(buf)) {
yyerror("string too long");
return (findeol());
}
@@ -1205,7 +1205,7 @@ yylex(void)
if (isalnum(c) || c == ':' || c == '_') {
do {
*p++ = c;
- if ((unsigned)(p-buf) >= sizeof(buf)) {
+ if ((size_t)(p-buf) >= sizeof(buf)) {
yyerror("string too long");
return (findeol());
}