diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 4a90116dd..45cdf4e27 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -532,8 +532,8 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf, return -RIG_EINVAL; } - // if this is an IF; cmd and not the first time through check cache - if (strncmp(cmd, "IF;", 3) == 0 && priv->cache_start.tv_sec != 0) + // if this is an IF cmd and not the first time through check cache + if (strcmp(cmd, "IF") == 0 && priv->cache_start.tv_sec != 0) { int cache_age_ms; @@ -548,15 +548,14 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf, // else we drop through and do the real IF command } - else if (cmd[2] != ';') + + if (strlen(cmd) > 2) { // then we must be setting something so we'll invalidate the cache rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__); priv->cache_start.tv_sec = 0; } - - memset(buf, 0, buf_size); if (expected == 0) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index f2fc8c4c1..0bfe42995 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -5943,7 +5943,7 @@ int newcat_get_cmd(RIG *rig) // this is for WSJT-X/JTDX sequence of v/f/m/t // should allow rapid repeat of any call using the IF; cmd // Any call that changes something in the IF response should invalidate the cache - if (strncmp(priv->cmd_str, "IF;", 2) == 0 && priv->cache_start.tv_sec != 0) + if (strcmp(priv->cmd_str, "IF;") == 0 && priv->cache_start.tv_sec != 0) { int cache_age_ms; @@ -5957,7 +5957,7 @@ int newcat_get_cmd(RIG *rig) } // we drop through and do the real IF command } - else if (priv->cmd_str[2] != ';') // then we must be setting something so we'll invalidate the cache + if (priv->cmd_str[2] != ';') // then we must be setting something so we'll invalidate the cache { rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__); priv->cache_start.tv_sec = 0;