From 5940e1c3f7d0b7a28b3fb0c85f51161efcbf595d Mon Sep 17 00:00:00 2001 From: Tom Early Date: Fri, 8 Feb 2019 09:21:00 -0700 Subject: [PATCH] one more logic error --- QnetModem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QnetModem.cpp b/QnetModem.cpp index 698c6cf..292d795 100644 --- a/QnetModem.cpp +++ b/QnetModem.cpp @@ -406,7 +406,7 @@ MODEM_RESPONSE CQnetModem::GetModemData(unsigned char *buf, unsigned int size) while (junk_count) { unsigned char junk[8]; - ret = read(serfd, junk, (junk_count < 8U) ? 8U : junk_count); + ret = read(serfd, junk, (junk_count > 8U) ? 8U : junk_count); if (ret < 0) { printf("Error when reading junk: %s\n", strerror(errno)); return ERROR_RESPONSE;