OSDN Git Service

Replace snprintf() with av_strlcpy().
authorPatrik <patrik@yes.nu>
Mon, 9 Feb 2009 23:11:26 +0000 (23:11 +0000)
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>
Mon, 9 Feb 2009 23:11:26 +0000 (23:11 +0000)
Fixes the following warning on some systems:
audioconvert.c:131: warning: format not a string literal and no format
arguments

Patch by Patrik patrik A yes D nu

Originally committed as revision 17110 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/audioconvert.c

index 40a7900..2f2ad8c 100644 (file)
@@ -128,7 +128,7 @@ void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels,
     for (i=0; channel_layout_map[i].name; i++)
         if (nb_channels    == channel_layout_map[i].nb_channels &&
             channel_layout == channel_layout_map[i].layout) {
-            snprintf(buf, buf_size, channel_layout_map[i].name);
+            av_strlcpy(buf, channel_layout_map[i].name, buf_size);
             return;
         }