diff gui/ui/gtk/fileselect.c @ 33740:2c02269701bd

Remove macros guiSetFilename() and guiSetDF() from interface.h. Rename guiSetFilename() setdup() and guiSetDF() setddup() and define them in string.c as functions. Adjust malloc size to necessary size and check pointer returned by malloc() to prevent segmentation fault.
author ib
date Thu, 07 Jul 2011 10:16:22 +0000
parents 9f6d46d325de
children c28c967e40e9
line wrap: on
line diff
--- a/gui/ui/gtk/fileselect.c	Thu Jul 07 09:29:15 2011 +0000
+++ b/gui/ui/gtk/fileselect.c	Thu Jul 07 10:16:22 2011 +0000
@@ -478,7 +478,7 @@
  switch ( fsType )
   {
    case fsVideoSelector:
-          guiSetDF( guiInfo.Filename,fsSelectedDirectory,fsSelectedFile );
+          setddup( &guiInfo.Filename,fsSelectedDirectory,fsSelectedFile );
           guiInfo.StreamType=STREAMTYPE_FILE;
           guiInfo.FilenameChanged=1; sub_fps=0;
 	  nfree( guiInfo.AudioFile );
@@ -486,17 +486,17 @@
           fs_PersistantHistory( get_current_dir_name_utf8() );      //totem, write into history
           break;
    case fsSubtitleSelector:
-          guiSetDF( guiInfo.Subtitlename,fsSelectedDirectory,fsSelectedFile );
+          setddup( &guiInfo.Subtitlename,fsSelectedDirectory,fsSelectedFile );
 	  guiLoadSubtitle( guiInfo.Subtitlename );
           break;
    case fsOtherSelector:
-          guiSetDF( guiInfo.Othername,fsSelectedDirectory,fsSelectedFile );
+          setddup( &guiInfo.Othername,fsSelectedDirectory,fsSelectedFile );
           break;
    case fsAudioSelector:
-          guiSetDF( guiInfo.AudioFile,fsSelectedDirectory,fsSelectedFile );
+          setddup( &guiInfo.AudioFile,fsSelectedDirectory,fsSelectedFile );
           break;
    case fsFontSelector:
-          guiSetDF( font_name,fsSelectedDirectory,fsSelectedFile );
+          setddup( &font_name,fsSelectedDirectory,fsSelectedFile );
 	  guiLoadFont();
 	  if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
 	  break;