fixed bad junk logic

pull/12/head
Tom Early 7 years ago
parent c4d04c6cc0
commit 5dea71448f

@ -406,12 +406,11 @@ MODEM_RESPONSE CQnetModem::GetModemData(unsigned char *buf, unsigned int size)
while (junk_count) { while (junk_count) {
unsigned char junk[8]; 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) { if (ret < 0) {
printf("Error when reading junk: %s\n", strerror(errno)); printf("Error when reading junk: %s\n", strerror(errno));
return ERROR_RESPONSE; return ERROR_RESPONSE;
} } else if (ret == 0) {
if (ret == 0) {
printf("READ junk RETURNED A ZERO!\n"); printf("READ junk RETURNED A ZERO!\n");
} else } else
junk_count -= (unsigned int)ret; junk_count -= (unsigned int)ret;

Loading…
Cancel
Save

Powered by TurnKey Linux.