USHRT_MAX might not be defined as 65535 on some architectures.