changeset 7583:b86106f3b272

use snprintf instead of sprintf
author pontscho
date Wed, 02 Oct 2002 14:57:42 +0000
parents 4a233f3b09a7
children 838ee1b00853
files Gui/mplayer/gtk/menu.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/menu.c	Wed Oct 02 13:16:15 2002 +0000
+++ b/Gui/mplayer/gtk/menu.c	Wed Oct 02 14:57:42 2002 +0000
@@ -309,7 +309,7 @@
       char tmp[32]; int i;
       for ( i=0;i < guiIntfStruct.VCDTracks;i++ )
        {
-        sprintf( tmp,MSGTR_MENU_Title,i+1 );
+        snprintf( tmp,32,MSGTR_MENU_Title,i+1 );
 	AddMenuItem( VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack );
        }
      }
@@ -330,7 +330,7 @@
        char tmp[32]; int i;
        for ( i=0;i < guiIntfStruct.DVD.titles;i++ )
         {
-         sprintf( tmp,MSGTR_MENU_Title,i+1 );
+         snprintf( tmp,32,MSGTR_MENU_Title,i+1 );
          AddMenuItem( DVDTitleMenu,tmp,( (i+1) << 16 ) + evSetDVDTitle );
         }
       }
@@ -345,7 +345,7 @@
        char tmp[32]; int i;
        for ( i=0;i < guiIntfStruct.DVD.chapters;i++ )
         {
-         sprintf( tmp,MSGTR_MENU_Chapter,i+1 );
+         snprintf( tmp,32,MSGTR_MENU_Chapter,i+1 );
          AddMenuItem( DVDChapterMenu,tmp,( (i+1) << 16 ) + evSetDVDChapter );
         }
       }
@@ -378,7 +378,7 @@
        AddMenuItem( DVDSubtitleLanguageMenu,"None",( (unsigned short)-1 << 16 ) + evSetDVDSubtitle );
        for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ )
         {
-         strcpy( tmp,GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) );
+	 snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) );
          AddMenuItem( DVDSubtitleLanguageMenu,tmp,( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle );
         }
       }