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 /usr.sbin/ldomctl | |
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 'usr.sbin/ldomctl')
-rw-r--r-- | usr.sbin/ldomctl/parse.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldomctl/parse.y b/usr.sbin/ldomctl/parse.y index a20599ec35a..273b0f7d9e0 100644 --- a/usr.sbin/ldomctl/parse.y +++ b/usr.sbin/ldomctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.9 2018/11/01 00:18:44 sashan Exp $ */ +/* $OpenBSD: parse.y,v 1.10 2019/02/13 22:57:08 deraadt Exp $ */ /* * Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org> @@ -431,7 +431,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()); } @@ -470,7 +470,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()); } |