diff --git a/examples/decode.c b/examples/decode.c index c352159..8fce493 100644 --- a/examples/decode.c +++ b/examples/decode.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -52,7 +53,8 @@ int main(int argc, char **argv) { patty_ax25_frame frame; if ((len = patty_kiss_tnc_recv(tnc, buf, PATTY_KISS_BUFSZ, &port)) < 0) { - perror("Unable to read frame"); + fprintf(stderr, "%s: %s: %s\n", + argv[0], "patty_kiss_tnc_recv()", strerror(errno)); goto error_kiss_tnc_recv; } else if (len == 0) { @@ -60,13 +62,15 @@ int main(int argc, char **argv) { } if (patty_ax25_frame_decode(&frame, PATTY_AX25_FRAME_NORMAL, buf, len) < 0) { - perror("Unable to decode frame"); + fprintf(stderr, "%s: %s: %s\n", + argv[0], "patty_ax25_frame_decode()", strerror(errno)); goto error_ax25_frame_decode; } if (patty_print_frame(stdout, &frame, buf, len) < 0) { - perror("Unable to print frame"); + fprintf(stderr, "%s: %s: %s\n", + argv[0], "patty_print_frame()", strerror(errno)); goto error_print_frame; }