it appears that there are mistakes in ntohl and ntohs.
for obvious reasons int is valid for both "unsigned long" and
"unsigned short" due to the usual conversions (and the local,
temporary conventions on amd64), but remember, type
signatures are based on C types, and may differ from the
implementation.
- erik
; 9diff ntohl.c
/n/sources/plan9/sys/src/ape/lib/bsd/ntohl.c:1,5 - ntohl.c:1,5
unsigned long
- ntohl(int x)
+ ntohl(unsigned long x)
{
unsigned long n;
unsigned char *p;
/n/sources/plan9/sys/src/ape/lib/bsd/ntohl.c:24,30 - ntohl.c:24,30
}
unsigned short
- ntohs(int x)
+ ntohs(unsigned short x)
{
unsigned short n;
unsigned char *p;