mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-19 20:48:22 +00:00
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:
parent
25937282ed
commit
fc863b6cd0
1 changed files with 1 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue