From 9d7c8e57711c6ebfb44c8f59eacb9c8ffaeb0951 Mon Sep 17 00:00:00 2001 From: David Malone Date: Sun, 23 Nov 2008 21:01:28 +0000 Subject: [PATCH] Make the new CCEQ macro a little more like the old one - first do the comparison between c and val and then compare val to _POSIX_VDISABLE. This avoids comparing c (which is usually of type char) to _POSIX_VDISABLE (which has value 0xff and may not be representable as a char). Reviewed by: ed --- sys/sys/termios.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/termios.h b/sys/sys/termios.h index 5f64b869b75..bc071fbf96c 100644 --- a/sys/sys/termios.h +++ b/sys/sys/termios.h @@ -234,7 +234,7 @@ struct termios { #ifndef _KERNEL #ifndef _POSIX_SOURCE -#define CCEQ(val, c) ((c) != _POSIX_VDISABLE && (c) == (val)) +#define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) #endif /*