Update tncattach.c

This commit is contained in:
IhorNehrutsa 2022-10-05 16:32:32 +03:00
parent d9b3d2b6ae
commit b65dd4c8fb
1 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ void read_loop(void) {
int poll_timeout = 1000;
while (should_continue) {
int poll_result = poll(fds, 2, poll_timeout);
int poll_result = poll(fds, N_FDS, poll_timeout);
if (poll_result != -1) {
if (poll_result == 0) {
// No resources are ready for reading,
@ -232,7 +232,7 @@ void read_loop(void) {
}
}
if (fdi == TNC_FD_INDEX) {
else if (fdi == TNC_FD_INDEX) {
int tnc_len = read(attached_tnc, serial_buffer, sizeof(serial_buffer));
if (tnc_len > 0) {
for (int i = 0; i < tnc_len; i++) {