tools: kwboot: Initialize rfds to zero

Explicitly zero out the rfds fd_set with FD_ZERO() before using it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Pali Rohár
2021-10-25 15:12:52 +02:00
committed by Stefan Roese
parent 03a8a5e26a
commit 0a14341cf8

View File

@@ -1151,6 +1151,7 @@ kwboot_terminal(int tty)
fd_set rfds;
int nfds = 0;
FD_ZERO(&rfds);
FD_SET(tty, &rfds);
nfds = nfds < tty ? tty : nfds;