Use PATTY_AX25_ADDRSTRLEN in patty_ax25_pton()

This commit is contained in:
XANTRONIX Development 2020-09-17 20:55:57 -05:00 committed by XANTRONIX Industrial
parent b8c19ea6cd
commit eaa3a3a06a

View file

@ -13,8 +13,7 @@ enum addr_state {
int patty_ax25_pton(const char *callsign,
patty_ax25_addr *addr) {
size_t len = strlen(callsign),
max = PATTY_AX25_CALLSIGN_LEN + 3; /* Account for SSID suffixes */
size_t len = strlen(callsign);
int i,
o = 0,
@ -26,8 +25,8 @@ int patty_ax25_pton(const char *callsign,
if (len == 0) {
goto error_invalid_callsign;
} else if (len > max) {
len = max;
} else if (len > PATTY_AX25_ADDRSTRLEN) {
len = PATTY_AX25_ADDRSTRLEN;
}
for (i=0; i<len; i++) {