X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fsplit.c;h=78dc8ab74d0ec40d107a104bfb3d3e1e3cbdd778;hp=05a7beebd9585b2d4141b26b4e284c881103feea;hb=30ba1eb06caca0b20a47d8dd75a117c82d730da7;hpb=2e44f90c21db693058037f83f92ad136c818ce9d diff --git a/src/split.c b/src/split.c index 05a7beeb..78dc8ab7 100644 --- a/src/split.c +++ b/src/split.c @@ -28,7 +28,7 @@ #endif #include "wimlib.h" -#include "wimlib/buffer_io.h" +#include "wimlib/endianness.h" #include "wimlib/error.h" #include "wimlib/file_io.h" #include "wimlib/lookup_table.h" @@ -224,7 +224,7 @@ wimlib_split(WIMStruct *w, const tchar *swm_name, for (int i = 1; i <= total_parts; i++) { const tchar *part_name; int part_fd; - u8 part_data_buf[4]; + le16 part_data[2]; size_t bytes_written; if (i == 1) { @@ -241,13 +241,13 @@ wimlib_split(WIMStruct *w, const tchar *swm_name, ret = WIMLIB_ERR_OPEN; goto out; } - put_u16(&part_data_buf[0], i); - put_u16(&part_data_buf[2], total_parts); + part_data[0] = cpu_to_le16(i); + part_data[1] = cpu_to_le16(total_parts); - bytes_written = full_pwrite(part_fd, part_data_buf, - sizeof(part_data_buf), 40); + bytes_written = full_pwrite(part_fd, part_data, + sizeof(part_data), 40); ret = close(part_fd); - if (bytes_written != sizeof(part_data_buf) || ret != 0) { + if (bytes_written != sizeof(part_data) || ret != 0) { ERROR_WITH_ERRNO("Error updating header of `%"TS"'", part_name); ret = WIMLIB_ERR_WRITE;