/* Copy 'size' bytes from 'src' to 'dest', correcting endianness if given 'islittle' is different from native endianness.  */
static void copywithendian(char *dest, const char *src, int size, int islittle)
/* Copy 'size' bytes from 'src' to 'dest', correcting endianness if given 'islittle' is different from native endianness.  */
static void copywithendian(char *dest, const char *src, int size, int islittle)
{
  if (islittle == nativeendian.little)
    memcpy(dest, src, size);
  else {
    dest += size - 1;
    while (size-- != 0)
      *(dest--) = *(src++);
  }
}