Skip to content

Commit

Permalink
flterm: add check if c is 0x00
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangfu Liu authored and Sebastien Bourdeauducq committed Aug 26, 2011
1 parent 9aa4a60 commit 3ccb7ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/flterm.c
Expand Up @@ -493,8 +493,8 @@ static void do_terminal(char *serial_port,
if(fds[1].revents & POLLIN) {
if(read(serialfd, &c, 1) <= 0) break;

if(logfd != NULL) {
if(isascii(c)) fwrite(&c, sizeof(c), 1, logfd);
if(logfd && c && isascii(c)) {
fwrite(&c, sizeof(c), 1, logfd);
if(c == '\n') fflush(logfd);
}

Expand Down

0 comments on commit 3ccb7ef

Please sign in to comment.