The SWAP16() macro is broken. unsigned u = SWAP16(0x1234); u will be 0x123412 instead of 0x3412. Here's a fix. I believe that the SWAP32() macro will also break in a similar way on systems where "int" is larger than 32 bits, but I have no way to test that conjecture. -- Grant Edwards grante@visi.com