On Oct 20, 2022, at 4:31 PM, Guy Harris <ghar...@sonic.net> wrote: > #if CHAR_MIN == 0 > #define CHAR_VALUE_IS_NEGATIVE(c) (0) > #else > #define CHAR_VALUE_IS_NEGATIVE(c) ((c) < 0) > #endif > > if ((CHAR_VALUE_IS_NEGAIVE(ba[i]) || ba[i] >= ' ') && ba[i] != > (char)0x7f && !g_ascii_isprint(ba[i])) {
Or just if (!g_ascii_isprint(ba[i])) { as g_ascii_isprint() 1) is a macro, so no subroutine call overhead and 2) already correctly handles both signed and unsigned char. ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev@wireshark.org> Archives: https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe