use unsigned char instead of u_char for better portability