Use tx_slots() inline function in src/sock.c

This commit is contained in:
XANTRONIX Development 2020-08-23 22:36:59 -05:00 committed by XANTRONIX Industrial
parent 44ec0040a8
commit fb982742f5

View file

@ -89,8 +89,8 @@ static inline void tx_slot_save(patty_ax25_sock *sock, void *buf, size_t len) {
}
static int init_bufs(patty_ax25_sock *sock) {
size_t i,
slots = sock->mode == PATTY_AX25_SOCK_SABME? 128: 8;
size_t slots = tx_slots(sock),
i;
if ((sock->tx_buf = realloc(sock->tx_buf, tx_bufsz(sock))) == NULL) {
goto error_realloc_tx_buf;
@ -815,9 +815,10 @@ int patty_ax25_sock_ack(patty_ax25_sock *sock, int nr) {
}
int patty_ax25_sock_ack_pending(patty_ax25_sock *sock) {
int ret = 0,
slots = sock->mode == PATTY_AX25_SOCK_SABME? 128: 8,
i;
int ret = 0;
size_t slots = tx_slots(sock),
i;
for (i=0; i<slots; i++) {
struct slot *slot = tx_slot(sock, i);