system/nxplayer: Fix the compiler warning
nxplayer.c: In function 'nxplayer_playinternal': Error: nxplayer.c:209:36: error: '%s' directive output may be truncated writing up to 99 bytes into a region of size 59 [-Werror=format-truncation=] 209 | snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", relurl); | ^~ ~~~~~~ nxplayer.c:209:3: note: 'snprintf' output between 19 and 118 bytes into a destination of size 64 209 | snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\r\n\r\n", relurl); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: nxplayer.c:1809:42: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=] 1809 | snprintf(path, sizeof(path), "%s/%s", pplayer->mediadir, pfilename); | ^ nxplayer.c:1809:7: note: 'snprintf' output 2 or more bytes (assuming 129) into a destination of size 128 1809 | snprintf(path, sizeof(path), "%s/%s", pplayer->mediadir, pfilename); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: nxplayer.c:359:53: error: '%s' directive output may be truncated writing up to 128 bytes into a region of size 53 [-Werror=format-truncation=] 359 | snprintf(path, sizeof(path), "/dev/audio/%s", pdevice->d_name); | ^~ nxplayer.c:359:11: note: 'snprintf' output between 12 and 140 bytes into a destination of size 64 359 | snprintf(path, sizeof(path), "/dev/audio/%s", pdevice->d_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
44b92d9254
commit
65a02ba9f9
@ -148,7 +148,7 @@ static int _open_with_http(const char *fullurl)
|
|||||||
char resp_msg[] = "\r\n\r\n";
|
char resp_msg[] = "\r\n\r\n";
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
uint16_t port = 80;
|
uint16_t port = 80;
|
||||||
char buf[64];
|
char buf[PATH_MAX];
|
||||||
int s;
|
int s;
|
||||||
int n;
|
int n;
|
||||||
char c;
|
char c;
|
||||||
@ -317,7 +317,7 @@ static int nxplayer_opendevice(FAR struct nxplayer_s *pplayer, int format,
|
|||||||
struct audio_caps_s caps;
|
struct audio_caps_s caps;
|
||||||
FAR struct dirent *pdevice;
|
FAR struct dirent *pdevice;
|
||||||
FAR DIR *dirp;
|
FAR DIR *dirp;
|
||||||
char path[64];
|
char path[PATH_MAX];
|
||||||
uint8_t supported = true;
|
uint8_t supported = true;
|
||||||
uint8_t x;
|
uint8_t x;
|
||||||
|
|
||||||
@ -1778,7 +1778,7 @@ static int nxplayer_playinternal(FAR struct nxplayer_s *pplayer,
|
|||||||
struct audio_caps_desc_s cap_desc;
|
struct audio_caps_desc_s cap_desc;
|
||||||
struct ap_buffer_info_s buf_info;
|
struct ap_buffer_info_s buf_info;
|
||||||
#ifdef CONFIG_NXPLAYER_INCLUDE_MEDIADIR
|
#ifdef CONFIG_NXPLAYER_INCLUDE_MEDIADIR
|
||||||
char path[128];
|
char path[PATH_MAX];
|
||||||
#endif
|
#endif
|
||||||
int tmpsubfmt = AUDIO_FMT_UNDEF;
|
int tmpsubfmt = AUDIO_FMT_UNDEF;
|
||||||
int ret;
|
int ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user