changeset 32401:69fb7b91bf76

Replace snprintf by av_strlcpy. Patch by Frdric Marchal [fmarchal perso be].
author reimar
date Wed, 13 Oct 2010 18:56:44 +0000
parents 83d15532e904
children 32eb0475a2d2
files gui/mplayer/gtk/gtk_menu.c stream/librtsp/rtsp_rtp.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/mplayer/gtk/gtk_menu.c	Wed Oct 13 18:38:50 2010 +0000
+++ b/gui/mplayer/gtk/gtk_menu.c	Wed Oct 13 18:56:44 2010 +0000
@@ -533,7 +533,7 @@
        AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle );
        for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ )
         {
-	 snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) );
+         av_strlcpy( tmp,GetLanguage( guiIntfStruct.DVD.subtitles[i].language ),sizeof(tmp) );
          AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp,
 			   dvdsub_id == guiIntfStruct.DVD.subtitles[i].id,
 			   ( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle );
--- a/stream/librtsp/rtsp_rtp.c	Wed Oct 13 18:38:50 2010 +0000
+++ b/stream/librtsp/rtsp_rtp.c	Wed Oct 13 18:56:44 2010 +0000
@@ -218,7 +218,7 @@
   len = strlen (parse1) - strlen (parse2)
     - strlen (RTSP_SETUP_DESTINATION) + 1;
   dest = (char *) malloc (len + 1);
-  snprintf (dest, len, parse1 + strlen (RTSP_SETUP_DESTINATION));
+  av_strlcpy (dest, parse1 + strlen (RTSP_SETUP_DESTINATION), len);
   free (line_copy);
 
   return dest;