mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
board/stm32_vs1053.c:191:27: Fix error: 'sprintf' writing a terminating nul past the end of the destination
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
ec77c2d3de
commit
3c5e1a865a
@@ -155,7 +155,7 @@ static int up_read_dreq(FAR const struct vs1053_lower_s *lower)
|
|||||||
void up_vs1053initialize(FAR struct spi_dev_s * spi)
|
void up_vs1053initialize(FAR struct spi_dev_s * spi)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char name[8];
|
char name[16];
|
||||||
FAR struct audio_lowerhalf_s *PVS1053;
|
FAR struct audio_lowerhalf_s *PVS1053;
|
||||||
|
|
||||||
/* Assumptions:
|
/* Assumptions:
|
||||||
@@ -188,7 +188,7 @@ void up_vs1053initialize(FAR struct spi_dev_s * spi)
|
|||||||
|
|
||||||
/* Now register the audio device */
|
/* Now register the audio device */
|
||||||
|
|
||||||
sprintf(name, "vs1053d%d", VS1053_DEVNO);
|
snprintf(name, sizeof(name), "vs1053d%d", VS1053_DEVNO);
|
||||||
ret = audio_register(name, PVS1053);
|
ret = audio_register(name, PVS1053);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user