changeset 25711:25b40c769b06

Fix 100l: error check for m_option_print was unreachable
author reimar
date Sun, 13 Jan 2008 16:22:43 +0000
parents 11faea7ffe9b
children 363e217ce9fd
files gui/cfg.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/cfg.c	Sun Jan 13 16:17:57 2008 +0000
+++ b/gui/cfg.c	Sun Jan 13 16:22:43 2008 +0000
@@ -293,11 +293,14 @@
    for ( i=0;gui_opts[i].name;i++ )
     {
       char* v = m_option_print(&gui_opts[i],gui_opts[i].p);
+      if(v == (char *)-1) {
+        mp_msg(MSGT_GPLAYER,MSGL_WARN,MSGTR_UnableToSaveOption, gui_opts[i].name);
+        v = NULL;
+      }
       if(v) {
 	fprintf( f,"%s = \"%s\"\n",gui_opts[i].name, v);
 	free(v);
-      } else if((int)v == -1)
-	mp_msg(MSGT_GPLAYER,MSGL_WARN,MSGTR_UnableToSaveOption, gui_opts[i].name);
+      }
     }
    fclose( f );
   }