Change sprintf to snprint in gs232a.c

https://github.com/Hamlib/Hamlib/issues/857
pull/928/head
Mike Black W9MDB 2022-01-09 11:54:31 -06:00
rodzic 00bdc63829
commit dff4f4f124
1 zmienionych plików z 11 dodań i 11 usunięć

Wyświetl plik

@ -177,7 +177,7 @@ gs232a_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
u_az = (unsigned)rint(az);
u_el = (unsigned)rint(el);
sprintf(cmdstr, "W%03u %03u" EOM, u_az, u_el);
snprintf(cmdstr, sizeof(cmdstr), "W%03u %03u" EOM, u_az, u_el);
retval = gs232a_transaction(rot, cmdstr, NULL, 0, 0);
if (retval != RIG_OK)
@ -283,7 +283,7 @@ static int gs232a_rot_set_level(ROT *rot, setting_t level, value_t val)
}
/* between 1 (slowest) and 4 (fastest) */
sprintf(cmdstr, "X%u" EOM, speed);
snprintf(cmdstr, sizeof(cmdstr), "X%u" EOM, speed);
retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1);
if (retval != RIG_OK)
@ -335,19 +335,19 @@ static int gs232a_rot_move(ROT *rot, int direction, int speed)
switch (direction)
{
case ROT_MOVE_UP: /* Elevation increase */
sprintf(cmdstr, "U" EOM);
snprintf(cmdstr, sizeof(cmdstr), "U" EOM);
break;
case ROT_MOVE_DOWN: /* Elevation decrease */
sprintf(cmdstr, "D" EOM);
snprintf(cmdstr, sizeof(cmdstr), "D" EOM);
break;
case ROT_MOVE_LEFT: /* Azimuth decrease */
sprintf(cmdstr, "L" EOM);
snprintf(cmdstr, sizeof(cmdstr), "L" EOM);
break;
case ROT_MOVE_RIGHT: /* Azimuth increase */
sprintf(cmdstr, "R" EOM);
snprintf(cmdstr, sizeof(cmdstr), "R" EOM);
break;
default:
@ -390,7 +390,7 @@ const struct rot_caps gs23_rot_caps =
ROT_MODEL(ROT_MODEL_GS23),
.model_name = "GS-23",
.mfg_name = "Yaesu/Kenpro",
.version = "20201203.0",
.version = "20220109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@ -434,7 +434,7 @@ const struct rot_caps gs232_rot_caps =
ROT_MODEL(ROT_MODEL_GS232),
.model_name = "GS-232",
.mfg_name = "Yaesu/Kenpro",
.version = "20201203.0",
.version = "20220109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@ -478,7 +478,7 @@ const struct rot_caps gs232a_rot_caps =
ROT_MODEL(ROT_MODEL_GS232A),
.model_name = "GS-232A",
.mfg_name = "Yaesu",
.version = "20201203.0",
.version = "20220109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@ -524,7 +524,7 @@ const struct rot_caps gs232a_az_rot_caps =
ROT_MODEL(ROT_MODEL_GS232A_AZ),
.model_name = "GS-232A azimuth",
.mfg_name = "Yaesu",
.version = "20201203.0",
.version = "20220109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZIMUTH,
@ -570,7 +570,7 @@ const struct rot_caps gs232a_el_rot_caps =
ROT_MODEL(ROT_MODEL_GS232A_EL),
.model_name = "GS-232A elevation",
.mfg_name = "Yaesu",
.version = "20201203.0",
.version = "20220109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_ELEVATION,