better TRE_CHAR_MAX fix