From 074fa2e1140c6afbeda5e7245d02384fb4c6e4c4 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 19 Nov 2017 20:59:20 +0200 Subject: [PATCH] mega-usb: support BE --- mega-usb/mega-usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mega-usb/mega-usb.c b/mega-usb/mega-usb.c index 2649797..be97b7c 100644 --- a/mega-usb/mega-usb.c +++ b/mega-usb/mega-usb.c @@ -151,6 +151,7 @@ static int write_with_check(int fd, const void *data, size_t size, char chk) static int send_file(int fd, const char *fname, const char *cmd) { + unsigned char blocks_b; char buf[0x10000]; int retval = -1; FILE *f = NULL; @@ -181,9 +182,10 @@ static int send_file(int fd, const char *fname, const char *cmd) blocksz = sizeof(buf); blocks = (size + blocksz - 1) / blocksz; + blocks_b = blocks; send_cmd(fd, cmd); - ret = write_with_check(fd, &blocks, 1, 'k'); + ret = write_with_check(fd, &blocks_b, 1, 'k'); if (ret) return ret; -- 2.39.5