From fb982742f50ad1154f4d26d1d1f402edb048a0d0 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 23 Aug 2020 22:36:59 -0500 Subject: [PATCH] Use tx_slots() inline function in src/sock.c --- src/sock.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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