examples/foc: fix snprintf warning

fix snprintf warning:

    foc_thr.c:110:39: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=]
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |                                       ^~
    foc_thr.c:110:36: note: directive argument in the range [-2147483648, 0]
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |                                    ^~~~~~
    foc_thr.c:110:3: note: 'snprintf' output between 5 and 15 bytes into a destination of size 10
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
raiden00pl 2024-09-28 10:38:02 +02:00 committed by Xiang Xiao
parent 25937282ed
commit fc863b6cd0

View file

@ -112,7 +112,7 @@ enum foc_controller_state_e
struct foc_ctrl_env_s
{
mqd_t mqd; /* Control msg queue */
int id; /* FOC device id */
uint8_t id; /* FOC device id */
int inst; /* Type specific instance counter */
int type; /* Controller type */
FAR struct foc_thr_cfg_s *cfg; /* Control thread configuration */