Show function names in errors in examples/decode.c
This commit is contained in:
parent
b9a6ef9ff3
commit
08389b8781
1 changed files with 7 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <patty/ax25.h>
|
||||
#include <patty/print.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue