[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. a56e976787f8dacf725ef
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-05-05 15:45:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via a56e976787f8dacf725efd7cf7a724081aaa0303 (commit) via 0721eb5ce686ec0bd82cab6a9f7a10fa2bbe60f8 (commit) via 9e8ef6dc9e7064852bfd664444cdd6bf7cc06324 (commit) from 7f60e1fcb036551e7bae101f13414f5fe3e58086 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a56e976787f8dacf725efd7cf7a724081aaa0303 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 5 10:45:22 2021 -0500 Add null checks in rig.c for ant_tx and ant_rx astyle rig.c diff --git a/src/rig.c b/src/rig.c index 08552d18..fe6dd94d 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2154,7 +2154,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) RETURNFUNC(-RIG_ENAVAIL); } - if (vfo == RIG_VFO_CURR) vfo = rig->state.current_vfo; + if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } if ((caps->targetable_vfo & RIG_TARGETABLE_MODE) || vfo == rig->state.current_vfo) @@ -2369,8 +2369,9 @@ pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode) rs = &rig->state; // return CW for CWR and RTTY for RTTYR - if (mode == RIG_MODE_CWR) mode = RIG_MODE_CW; - if (mode == RIG_MODE_RTTYR) mode = RIG_MODE_RTTY; + if (mode == RIG_MODE_CWR) { mode = RIG_MODE_CW; } + + if (mode == RIG_MODE_RTTYR) { mode = RIG_MODE_RTTY; } for (i = 0; i < HAMLIB_FLTLSTSIZ && rs->filters[i].modes; i++) { @@ -2946,7 +2947,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) // some rigs like the FT-2000 with the SCU-17 need just a bit of time to let the relays work // can affect fake it mode in WSJT-X when the rig is still in transmit and freq change // is requested on a rig that can't change freq on a transmitting VFO - if (ptt != RIG_PTT_ON) hl_usleep(10*1000); + if (ptt != RIG_PTT_ON) { hl_usleep(10 * 1000); } rig->state.cache.ptt = ptt; elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); @@ -5087,8 +5088,11 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, RETURNFUNC(-RIG_EIO); } - if (ant_curr == NULL) + if (ant_curr == NULL || ant_tx == NULL || ant_rx == NULL) { + rig_debug(RIG_DEBUG_ERR, + "%s: null pointer in ant_curr=%p, ant_tx=%p, ant_rx=%p\n", __func__, ant_curr, + ant_tx, ant_rx); RETURNFUNC(-RIG_EINVAL); } commit 0721eb5ce686ec0bd82cab6a9f7a10fa2bbe60f8 Merge: 7f60e1fc 9e8ef6dc Author: Michael Black <mdb...@ya...> Date: Wed May 5 10:42:06 2021 -0500 Merge pull request #691 from mikaelnousiainen/fix-get-ant-null-check Fix rig_get_ant NULL check commit 9e8ef6dc9e7064852bfd664444cdd6bf7cc06324 Author: Mikael Nousiainen <mik...@ik...> Date: Wed May 5 18:23:02 2021 +0300 Fix rig_get_ant NULL check diff --git a/src/rig.c b/src/rig.c index eb1e099e..08552d18 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5087,7 +5087,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, RETURNFUNC(-RIG_EIO); } - if (ant_curr) + if (ant_curr == NULL) { RETURNFUNC(-RIG_EINVAL); } ----------------------------------------------------------------------- Summary of changes: src/rig.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |