made check_char inline