X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/01aa068b6ff34d86dd5d9d9e962aba20cd490050..d6e1d482844d6979533250dedc3724ce14f80294:/client/comms.c 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) {