>+#if defined(WORDS_BIGENDIAN) > for (p = buf; p < buf + nread; p++) > { > b = *p; > *p++ = *(p + 1); > *p = b; > } >+#endif > } > Why not use htons() which should be a little more efficient?