diff --git a/handy.h b/handy.h index acd1929f9716..91dec7634093 100644 --- a/handy.h +++ b/handy.h @@ -1438,10 +1438,10 @@ or casts #ifndef __COVERITY__ /* The '| 0' part ensures a compiler error if c is not integer (like e.g., a * pointer) */ -#define FITS_IN_8_BITS(c) ( (sizeof(c) == 1) \ - || !(((WIDEST_UTYPE)((c) | 0)) & ~0xFF)) +# define FITS_IN_8_BITS(c) ( (sizeof(c) == 1) \ + || ((WIDEST_UTYPE)((c) | 0) == ((U8)(c)))) #else -#define FITS_IN_8_BITS(c) (1) +# define FITS_IN_8_BITS(c) (1) #endif /* Returns true if l <= c <= (l + n), where 'l' and 'n' are non-negative