summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-02-13 22:57:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-02-13 22:57:09 +0000
commit6441905bfeadbf0368fbc36fe6e83edbb69f00cc (patch)
tree6c4e63a5ad6c7428885d4b20bec9ed07a40e4357 /usr.sbin/bgpd
parent9413373390f5ee708253a32ce47ecee80a45b2bc (diff)
(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/bgpd')
-rw-r--r--usr.sbin/bgpd/parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 297ab8553cd..53017ea3125 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.371 2019/02/12 09:02:41 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.372 2019/02/13 22:57:08 deraadt Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -3147,7 +3147,7 @@ top:
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());
}
@@ -3186,7 +3186,7 @@ nodigits:
if (isalnum(c) || 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());
}