From: pwpiwi Date: Thu, 6 Feb 2020 06:59:18 +0000 (+0100) Subject: fix WaitForResponse (without timeout) X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/df7b80fecce977455a542e6a0a82a17e62521301 fix WaitForResponse (without timeout) --- diff --git a/client/comms.c b/client/comms.c index dcbd3ada..b3b85fd2 100644 --- a/client/comms.c +++ b/client/comms.c @@ -472,7 +472,6 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo #endif uint64_t start_time = msclock(); - uint64_t end_time = start_time + ms_timeout; if (response == NULL) { response = &resp; @@ -480,7 +479,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo // Wait until the command is received while (true) { - if (msclock() > end_time) { + if (ms_timeout != -1 && msclock() > start_time + ms_timeout) { break; // timeout } if (msclock() - start_time > 2000 && show_warning) {