changeset 25712:363e217ce9fd

Win32 gui has the same m_option_print error handling bug
author reimar
date Sun, 13 Jan 2008 16:25:33 +0000
parents 25b40c769b06
children 0fe20154a883
files gui/win32/wincfg.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/win32/wincfg.c	Sun Jan 13 16:22:43 2008 +0000
+++ b/gui/win32/wincfg.c	Sun Jan 13 16:25:33 2008 +0000
@@ -130,13 +130,15 @@
         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);
     }