diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-02-13 22:57:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-02-13 22:57:09 +0000 |
commit | 6441905bfeadbf0368fbc36fe6e83edbb69f00cc (patch) | |
tree | 6c4e63a5ad6c7428885d4b20bec9ed07a40e4357 /sbin/iked | |
parent | 9413373390f5ee708253a32ce47ecee80a45b2bc (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 'sbin/iked')
-rw-r--r-- | sbin/iked/parse.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index a786d217074..608d73745cf 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.77 2018/11/07 08:10:45 miko Exp $ */ +/* $OpenBSD: parse.y,v 1.78 2019/02/13 22:57:07 deraadt Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -1418,7 +1418,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()); } @@ -1457,7 +1457,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()); } |