Change sprintf to snprint in rotorez.c

https://github.com/Hamlib/Hamlib/issues/857
pull/928/head
Mike Black W9MDB 2022-01-09 11:48:08 -06:00
rodzic 390d05ec69
commit 4adcda259a
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -135,7 +135,7 @@ const struct rot_caps rotorez_rot_caps =
ROT_MODEL(ROT_MODEL_ROTOREZ),
.model_name = "Rotor-EZ",
.mfg_name = "Idiom Press",
.version = "20100214.0",
.version = "20220109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@ -436,7 +436,7 @@ static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth,
azimuth = 0;
}
sprintf(cmdstr, "AP1%03.0f;", azimuth); /* Target bearing */
snprintf(cmdstr, sizeof(cmdstr), "AP1%03.0f;", azimuth); /* Target bearing */
err = rotorez_send_priv_cmd(rot, cmdstr);
if (err != RIG_OK)
@ -481,7 +481,7 @@ static int rt21_rot_set_position(ROT *rot, azimuth_t azimuth,
return -RIG_EINVAL;
}
sprintf(cmdstr, "AP1%05.1f\r;", azimuth); /* Total field width of 5 chars */
snprintf(cmdstr, sizeof(cmdstr), "AP1%05.1f\r;", azimuth); /* Total field width of 5 chars */
err = rotorez_send_priv_cmd(rot, cmdstr);
if (err != RIG_OK)
@ -491,7 +491,7 @@ static int rt21_rot_set_position(ROT *rot, azimuth_t azimuth,
if (rot->state.rotport2.pathname[0] != 0)
{
sprintf(cmdstr, "AP1%05.1f\r;",
snprintf(cmdstr, sizeof(cmdstr), "AP1%05.1f\r;",
elevation); /* Total field width of 5 chars */
err = rotorez_send_priv_cmd2(rot, cmdstr);