From 779bf68ab170064d9346a3e835cd32de12d8ca1a Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 29 Apr 2017 16:23:50 +0200 Subject: [PATCH] Fix some compiler errors with -Werror=format-security --- src/vgmstream.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vgmstream.c b/src/vgmstream.c index 67e3ea16..2a1feb0c 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -1994,9 +1994,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) { ffmpeg_codec_data *data = (ffmpeg_codec_data *) vgmstream->codec_data; if (vgmstream->codec_data) { if (data->codec && data->codec->long_name) { - snprintf(temp,TEMPSIZE,data->codec->long_name); + snprintf(temp,TEMPSIZE,"%s",data->codec->long_name); } else if (data->codec && data->codec->name) { - snprintf(temp,TEMPSIZE,data->codec->name); + snprintf(temp,TEMPSIZE,"%s",data->codec->name); } else { snprintf(temp,TEMPSIZE,"FFmpeg (unknown codec)"); } @@ -2010,7 +2010,7 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) { description = get_vgmstream_coding_description(vgmstream->coding_type); if (!description) description = "CANNOT DECODE"; - strncpy(temp,description,TEMPSIZE); + snprintf(temp,TEMPSIZE,"%s",description); break; } concatn(length,desc,temp); @@ -2023,7 +2023,7 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) { description = get_vgmstream_layout_description(vgmstream->layout_type); if (!description) description = "INCONCEIVABLE"; - strncpy(temp,description,TEMPSIZE); + snprintf(temp,TEMPSIZE,"%s",description); break; } concatn(length,desc,temp); @@ -2073,7 +2073,7 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) { description = get_vgmstream_meta_description(vgmstream->meta_type); if (!description) description = "THEY SHOULD HAVE SENT A POET"; - strncpy(temp,description,TEMPSIZE); + snprintf(temp,TEMPSIZE,"%s",description); break; } concatn(length,desc,temp);