rc_update: Use snprintf over sprintf

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2023-05-11 20:28:04 -06:00 committed by Beat Küng
parent 837847f3ad
commit 5fff0526cf
1 changed files with 5 additions and 5 deletions

View File

@ -72,23 +72,23 @@ RCUpdate::RCUpdate() :
char nbuf[16];
/* min values */
sprintf(nbuf, "RC%d_MIN", i + 1);
snprintf(nbuf, sizeof(nbuf), "RC%d_MIN", i + 1);
_parameter_handles.min[i] = param_find(nbuf);
/* trim values */
sprintf(nbuf, "RC%d_TRIM", i + 1);
snprintf(nbuf, sizeof(nbuf), "RC%d_TRIM", i + 1);
_parameter_handles.trim[i] = param_find(nbuf);
/* max values */
sprintf(nbuf, "RC%d_MAX", i + 1);
snprintf(nbuf, sizeof(nbuf), "RC%d_MAX", i + 1);
_parameter_handles.max[i] = param_find(nbuf);
/* channel reverse */
sprintf(nbuf, "RC%d_REV", i + 1);
snprintf(nbuf, sizeof(nbuf), "RC%d_REV", i + 1);
_parameter_handles.rev[i] = param_find(nbuf);
/* channel deadzone */
sprintf(nbuf, "RC%d_DZ", i + 1);
snprintf(nbuf, sizeof(nbuf), "RC%d_DZ", i + 1);
_parameter_handles.dz[i] = param_find(nbuf);
}