We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9aa4a60 commit 3ccb7efCopy full SHA for 3ccb7ef
tools/flterm.c
@@ -493,8 +493,8 @@ static void do_terminal(char *serial_port,
493
if(fds[1].revents & POLLIN) {
494
if(read(serialfd, &c, 1) <= 0) break;
495
496
- if(logfd != NULL) {
497
- if(isascii(c)) fwrite(&c, sizeof(c), 1, logfd);
+ if(logfd && c && isascii(c)) {
+ fwrite(&c, sizeof(c), 1, logfd);
498
if(c == '\n') fflush(logfd);
499
}
500
0 commit comments