Porting to Intel

An IP address is not a long int – it’s 4 bytes. Doing something like this is bad:

sprintf(buf,”%ld.%ld.%ld.%ld”, (ip>>24) & 255, (ip>>16) & 255, (ip>> 8 ) & 255, ip & 255);

Comments are closed.