Change sprintf to snprint in codan

https://github.com/Hamlib/Hamlib/issues/857
pull/928/head
Mike Black W9MDB 2022-01-11 23:52:37 -06:00
rodzic 69bae15cf2
commit ab8a74a48d
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -278,7 +278,7 @@ int codan_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return -RIG_EINVAL;
}
sprintf((char *) cmd_buf, "mode %s", ttmode);
SNPRINTF((char *) cmd_buf, sizeof(cmd_buf), "mode %s", ttmode);
retval = codan_transaction(rig, cmd_buf, 0, &response);
@ -304,7 +304,7 @@ int codan_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_strvfo(vfo), freq);
// Purportedly can't do split so we just set VFOB=VFOA
sprintf(cmd_buf, "connect tcvr rf %.0f %.0f\rfreq", freq, freq);
SNPRINTF(cmd_buf, sizeof(cmd_buf), "connect tcvr rf %.0f %.0f\rfreq", freq, freq);
char *response = NULL;
retval = codan_transaction(rig, cmd_buf, 0, &response);
@ -397,7 +397,7 @@ int codan_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt);
sprintf(cmd_buf, "connect tcvr rf ptt %s\rptt", ptt == 0 ? "off" : "on");
SNPRINTF(cmd_buf, sizeof(cmd_buf), "connect tcvr rf ptt %s\rptt", ptt == 0 ? "off" : "on");
response = NULL;
retval = codan_transaction(rig, cmd_buf, 0, &response);