** Copy 'size' bytes from 'src' to 'dest', correcting endianness if ** given 'islittle' is different from native endianness. */
| 1587 | ** given 'islittle' is different from native endianness. |
| 1588 | */ |
| 1589 | static void copywithendian (char *dest, const char *src, |
| 1590 | int size, int islittle) { |
| 1591 | if (islittle == nativeendian.little) |
| 1592 | memcpy(dest, src, size); |
| 1593 | else { |
| 1594 | dest += size - 1; |
| 1595 | while (size-- != 0) |
| 1596 | *(dest--) = *(src++); |
| 1597 | } |
| 1598 | } |
| 1599 | |
| 1600 | |
| 1601 | static int str_pack (lua_State *L) { |
no outgoing calls
no test coverage detected