void memcpy(void *dest, const void *src, int bytes)
{
- char * cdest = dest;
- char * csrc = src;
+ char *cdest = dest;
+ const char *csrc = src;
while (bytes--)
*(cdest++) = *(csrc++);
}
tohex(d, l);
puts(d);
}
+
+unsigned short htons(unsigned short in)
+{
+ return (in >> 8) | (in << 8);
+}