From 805cd8e60b380b78fe6dc3d67167a03d9b298219 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Wed, 5 May 2021 15:13:56 -0500 Subject: [PATCH] Move ant_rx ant_tx set to after NULL check in rig.c https://github.com/Hamlib/Hamlib/pull/691#issuecomment-832918894 --- src/rig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rig.c b/src/rig.c index fe6dd94d5..3ca657694 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5081,8 +5081,6 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ENTERFUNC; - *ant_tx = *ant_rx = RIG_ANT_UNKNOWN; - if (CHECK_RIG_ARG(rig)) { RETURNFUNC(-RIG_EIO); @@ -5096,6 +5094,8 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, RETURNFUNC(-RIG_EINVAL); } + *ant_tx = *ant_rx = RIG_ANT_UNKNOWN; + caps = rig->caps; if (caps->get_ant == NULL)