chiark / gitweb /
Update grapheme break algorithm to Unicode 5.1.0 (based on UAX #29)
[disorder] / lib / configuration.c
index 5691e8ae24e518fa1d79ab3fe53d1a317281ae0a..1fcfb1a6eefd138ef66aaba05dfa47438632c8da 100644 (file)
@@ -510,6 +510,7 @@ static void free_none(struct config attribute((unused)) *c,
 static void free_string(struct config *c,
                        const struct conf *whoami) {
   xfree(VALUE(c, char *));
+  VALUE(c, char *) = 0;
 }
 
 static void free_stringlist(struct config *c,
@@ -833,27 +834,6 @@ static int validate_alias(const struct config_state *cs,
   return 0;
 }
 
-static int validate_addrport(const struct config_state attribute((unused)) *cs,
-                            int nvec,
-                            char attribute((unused)) **vec) {
-  switch(nvec) {
-  case 0:
-    error(0, "%s:%d: missing address",
-         cs->path, cs->line);
-    return -1;
-  case 1:
-    error(0, "%s:%d: missing port name/number",
-         cs->path, cs->line);
-    return -1;
-  case 2:
-    return 0;
-  default:
-    error(0, "%s:%d: expected ADDRESS PORT",
-         cs->path, cs->line);
-    return -1;
-  }
-}
-
 static int validate_algo(const struct config_state attribute((unused)) *cs,
                         int nvec,
                         char **vec) {
@@ -933,7 +913,7 @@ static const struct conf conf[] = {
   { C(checkpoint_kbyte), &type_integer,          validate_non_negative },
   { C(checkpoint_min),   &type_integer,          validate_non_negative },
   { C(collection),       &type_collections,      validate_any },
-  { C(connect),          &type_stringlist,       validate_addrport },
+  { C(connect),          &type_netaddress,       validate_destaddr },
   { C(cookie_login_lifetime),  &type_integer,    validate_positive },
   { C(cookie_key_lifetime),  &type_integer,      validate_positive },
   { C(dbversion),        &type_integer,          validate_positive },
@@ -1223,6 +1203,7 @@ static struct config *config_default(void) {
   c->broadcast.af = -1;
   c->broadcast_from.af = -1;
   c->listen.af = -1;
+  c->connect.af = -1;
   return c;
 }