s/PATTY_AX25_CALLSIGN_LEN/PATTY_AX25_CALLSTRLEN/g

This commit is contained in:
XANTRONIX Development 2020-09-18 14:33:16 -05:00 committed by XANTRONIX Industrial
parent e2796596ac
commit 77bb1bf030
3 changed files with 8 additions and 8 deletions

View file

@ -8,8 +8,8 @@
#include <patty/list.h>
#include <patty/dict.h>
#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;

View file

@ -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; i<PATTY_AX25_CALLSIGN_LEN; i++) {
for (i=0; i<PATTY_AX25_CALLSTRLEN; i++) {
uint8_t c;
if (o == len) {
@ -136,7 +136,7 @@ static inline void hash_byte(uint32_t *hash, uint8_t c) {
void patty_ax25_addr_hash(uint32_t *hash, const patty_ax25_addr *addr) {
size_t i;
for (i=0; i<PATTY_AX25_CALLSIGN_LEN; i++) {
for (i=0; i<PATTY_AX25_CALLSTRLEN; i++) {
hash_byte(hash, addr->callsign[i] >> 1);
}

View file

@ -17,7 +17,7 @@ static ssize_t decode_station(patty_ax25_addr *addr,
goto error;
}
for (i=0; i<PATTY_AX25_CALLSIGN_LEN; i++) {
for (i=0; i<PATTY_AX25_CALLSTRLEN; i++) {
uint8_t b = ((uint8_t *)data + offset)[i];
uint8_t c = b >> 1;