comparison calypso/main.c @ 12:2260fbd28b2a

fcsim-calypso-be: flush stdout
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Mar 2021 07:17:26 +0000
parents f6b03af63bf7
children
comparison
equal deleted inserted replaced
11:60fd23186e2e 12:2260fbd28b2a
60 unsigned len; 60 unsigned len;
61 61
62 parse_target_fd_opt(argc, argv); 62 parse_target_fd_opt(argc, argv);
63 set_serial_nonblock(0); 63 set_serial_nonblock(0);
64 putchar('\n'); 64 putchar('\n');
65 fflush(stdout);
65 66
66 while (fgets(inbuf, sizeof inbuf, stdin)) { 67 for (; fgets(inbuf, sizeof inbuf, stdin); fflush(stdout)) {
67 cp = index(inbuf, '\n'); 68 cp = index(inbuf, '\n');
68 if (!cp) { 69 if (!cp) {
69 printf("back end error: missing newline on input\n"); 70 printf("back end error: missing newline on input\n");
70 continue; 71 continue;
71 } 72 }