diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2008-11-23 21:01:28 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2008-11-23 21:01:28 +0000 |
commit | 936ec723e146d4cf7ef6c57493488c1b2658a6d4 (patch) | |
tree | 6202268333c587aa36740df6d83fc29aeb28feab | |
parent | 465185b1927999f43e3e22933fc6ce9d51b525d0 (diff) | |
download | FreeBSD-src-936ec723e146d4cf7ef6c57493488c1b2658a6d4.zip FreeBSD-src-936ec723e146d4cf7ef6c57493488c1b2658a6d4.tar.gz |
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
-rw-r--r-- | sys/sys/termios.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/termios.h b/sys/sys/termios.h index 5f64b86..bc071fb 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 /* |