validate_length: added int support (without using ranges)