diff --git a/src/sock.c b/src/sock.c index ca983ca..c39df4a 100644 --- a/src/sock.c +++ b/src/sock.c @@ -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