We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2353955 commit 9aa4a60Copy full SHA for 9aa4a60
tools/flterm.c
@@ -24,6 +24,7 @@
24
#include <sys/ioctl.h>
25
#include <sys/time.h>
26
#include <string.h>
27
+#include <ctype.h>
28
#include <termios.h>
29
#include <fcntl.h>
30
#include <unistd.h>
@@ -492,8 +493,10 @@ static void do_terminal(char *serial_port,
492
493
if(fds[1].revents & POLLIN) {
494
if(read(serialfd, &c, 1) <= 0) break;
495
- fwrite(&c, sizeof(c), 1, logfd);
496
- fflush(logfd);
+ if(logfd != NULL) {
497
+ if(isascii(c)) fwrite(&c, sizeof(c), 1, logfd);
498
+ if(c == '\n') fflush(logfd);
499
+ }
500
501
if(gdbfd != -1 && rsp_pending && (c == '+' || c == '-')) {
502
rsp_pending = 0;
0 commit comments