diff --git a/include/patty/ax25.h b/include/patty/ax25.h index 01746d0..04d79c7 100644 --- a/include/patty/ax25.h +++ b/include/patty/ax25.h @@ -8,8 +8,8 @@ #include #include -#define PATTY_AX25_CALLSIGN_LEN 6 -#define PATTY_AX25_ADDRSTRLEN (PATTY_AX25_CALLSIGN_LEN + 3) +#define PATTY_AX25_CALLSTRLEN 6 +#define PATTY_AX25_ADDRSTRLEN (PATTY_AX25_CALLSTRLEN + 3) #define PATTY_AX25_IF_NAME_SIZE 8 #define PATTY_AX25_MAX_HOPS 8 #define PATTY_AX25_SOCK_PATH_SIZE 256 @@ -42,7 +42,7 @@ enum patty_ax25_proto { #pragma pack(1) typedef struct _patty_ax25_addr { - char callsign[PATTY_AX25_CALLSIGN_LEN]; + char callsign[PATTY_AX25_CALLSTRLEN]; uint8_t ssid; } patty_ax25_addr; diff --git a/src/ax25.c b/src/ax25.c index f453244..c9dd7ad 100644 --- a/src/ax25.c +++ b/src/ax25.c @@ -34,7 +34,7 @@ int patty_ax25_pton(const char *callsign, switch (state) { case ADDR_CALLSIGN: - if (o > PATTY_AX25_CALLSIGN_LEN) { + if (o > PATTY_AX25_CALLSTRLEN) { goto error_invalid_callsign; } @@ -64,7 +64,7 @@ int patty_ax25_pton(const char *callsign, } } - while (o < PATTY_AX25_CALLSIGN_LEN) { + while (o < PATTY_AX25_CALLSTRLEN) { addr->callsign[o++] = ' ' << 1; } @@ -86,7 +86,7 @@ int patty_ax25_ntop(const patty_ax25_addr *addr, int ssid = (addr->ssid & 0x1e) >> 1; - for (i=0; icallsign[i] >> 1); } diff --git a/src/frame.c b/src/frame.c index f238afe..e5cde26 100644 --- a/src/frame.c +++ b/src/frame.c @@ -17,7 +17,7 @@ static ssize_t decode_station(patty_ax25_addr *addr, goto error; } - for (i=0; i> 1;