Use fflush() for each frame in examples/ax25dump.c

This commit is contained in:
XANTRONIX Development 2020-07-18 16:26:41 -04:00 committed by XANTRONIX Industrial
parent 305653e19b
commit 420b406411

View file

@ -119,7 +119,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "%s: %s: %s\n", fprintf(stderr, "%s: %s: %s\n",
argv[0], "patty_print_frame_header()", strerror(errno)); argv[0], "patty_print_frame_header()", strerror(errno));
goto error_print; goto error_io;
} }
if (frame.type == PATTY_AX25_FRAME_XID) { if (frame.type == PATTY_AX25_FRAME_XID) {
@ -136,12 +136,16 @@ int main(int argc, char **argv) {
} }
if (patty_print_params(stdout, &params) < 0) { if (patty_print_params(stdout, &params) < 0) {
goto error_print; goto error_io;
} }
} }
if (patty_print_hexdump(stdout, buf, readlen) < 0) { if (patty_print_hexdump(stdout, buf, readlen) < 0) {
goto error_print; goto error_io;
}
if (fflush(stdout) < 0) {
goto error_io;
} }
} }
@ -153,7 +157,7 @@ int main(int argc, char **argv) {
return 0; return 0;
error_print: error_io:
error_ax25_frame_decode_xid: error_ax25_frame_decode_xid:
error_ax25_frame_decode_control: error_ax25_frame_decode_control:
error_ax25_frame_decode_address: error_ax25_frame_decode_address: