From c83c28edb4b4edb6b9afb54195bc117833bc8c9e Mon Sep 17 00:00:00 2001 From: Frank Li Date: Fri, 25 Jan 2019 13:15:02 -0600 Subject: [PATCH] fixed #79 all data is zero when file transfer from target to windows PC Signed-off-by: Frank Li --- libuuu/fastboot.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libuuu/fastboot.cpp b/libuuu/fastboot.cpp index ee0bb870..c8708e17 100644 --- a/libuuu/fastboot.cpp +++ b/libuuu/fastboot.cpp @@ -63,8 +63,6 @@ int FastBoot::Transport(string cmd, void *p, size_t size, vector *input { size_t sz; sz = strtoul(buff+4, NULL, 16); - if (sz > size) - sz = size; if (input) { @@ -76,6 +74,9 @@ int FastBoot::Transport(string cmd, void *p, size_t size, vector *input } else { + if (sz > size) + sz = size; + if (m_pTrans->write(p, sz)) return -1; }