diff --git a/src/fwrite_le.c b/src/fwrite_le.c index 5ab9a1a..ee5ff12 100644 --- a/src/fwrite_le.c +++ b/src/fwrite_le.c @@ -49,9 +49,14 @@ size_t fwrite_le(void* ptr, size_t size, size_t count, FILE* stream) { const size_t div_size = size >> 1; // divide by 2 for (size_t j = 0; j < div_size; j++) { const size_t old_pos = i + j, new_pos = i + size - j - 1; +#if FWRITE_LE_NO_MODIFICATION + bytes[old_pos] = ptr[new_pos]; + bytes[new_pos] = ptr[old_pos]; +#else uint8_t temp = bytes[old_pos]; bytes[old_pos] = bytes[new_pos]; bytes[new_pos] = temp; +#endif } }