cfgparser: make sure olsrd_parse_cnf is used consistently
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 May 2012 10:52:41 +0000 (12:52 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 May 2012 10:54:29 +0000 (12:54 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
gui/win32/Main/MyDialog2.cpp
src/cfgparser/olsrd_conf.c
src/cfgparser/version-script.txt

index 8809600..b29363c 100644 (file)
@@ -241,11 +241,11 @@ int MyDialog2::OpenConfigFile(CString PathName)
        if (Conf != NULL)
                olsrd_free_cnf(Conf);
 
-       Conf = olsrd_parse_cnf(PathName);
-
-       if (Conf == NULL)
+       if (olsrd_parse_cnf(PathName) < 0)
                return -1;
 
+       Conf = olsr_cnf;
+
        for (i = 0; i < NumInt; i++)
                m_InterfaceList.SetCheck(i, FALSE);
 
index 04780a4..422660f 100644 (file)
@@ -106,7 +106,7 @@ main(int argc, char *argv[])
     exit(EXIT_FAILURE);
   }
 
-  if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
+  if ((cnf = olsrd_parse_cnf(argv[1])) == 0) {
     if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
       olsrd_print_cnf(cnf);
       olsrd_write_cnf(cnf, "./out.conf");
index dd888e2..28fd3a1 100644 (file)
@@ -9,7 +9,6 @@ VERS_1.0
     olsrd_write_cnf_buf;
     get_default_if_config;
     olsrd_get_default_cnf;
-    olsrd_parse_cnf;
     win32_stdio_hack;
     win32_olsrd_malloc;
     win32_olsrd_free;