From: notaz Date: Sun, 19 Nov 2017 18:59:20 +0000 (+0200) Subject: mega-usb: support BE X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=074fa2e1140c6afbeda5e7245d02384fb4c6e4c4;p=megadrive.git mega-usb: support BE --- 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;