Better error messages for missing brace
authorAlan T. DeKok <aland@freeradius.org>
Wed, 21 Apr 2010 06:56:54 +0000 (08:56 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 26 Apr 2010 14:02:55 +0000 (16:02 +0200)
src/main/conffile.c

index b56f5ba..f59dd3a 100644 (file)
@@ -1168,6 +1168,7 @@ static int condition_looks_ok(const char **ptr)
                                 *      Parse error.
                                 */
                                if (*q != '{') {
+                                       DEBUG2("Expected open brace '{' after condition at %s", p);
                                        return 0;
                                }
 
@@ -1191,6 +1192,7 @@ static int condition_looks_ok(const char **ptr)
                }
        }
 
+       DEBUG3("Unexpected error");
        return 0;
 }
 
@@ -2680,11 +2682,11 @@ int cf_section2file(FILE *fp, const CONF_SECTION *cs)
 
                switch (ci->type) {
                case CONF_ITEM_PAIR:
-                       if (!cf_pair2file(fp, (CONF_PAIR *) ci)) return 0;
+                       if (!cf_pair2file(fp, (const CONF_PAIR *) ci)) return 0;
                        break;
 
                case CONF_ITEM_SECTION:
-                       if (!cf_section2file(fp, (CONF_SECTION *) ci)) return 0;
+                       if (!cf_section2file(fp, (const CONF_SECTION *) ci)) return 0;
                        break;
 
                default:        /* should really be an error. */