Fix debug output of name of transport option list being matched
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 16 Nov 2014 20:57:10 +0000 (20:57 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 16 Nov 2014 21:28:53 +0000 (21:28 +0000)
src/src/readconf.c

index 074ed9615147b9d1d8e4e500ff3340d767b1466a..40af94024d7a71677e3a01f516fcab8613519863 100644 (file)
@@ -497,7 +497,7 @@ for (i = 0; i < optionlist_config_size; i++)
 for (r = routers; r != NULL; r = r->next)
   {
   router_info *ri = r->info;
-  for (i = 0; i < ri->options_count[0]; i++)
+  for (i = 0; i < *ri->options_count; i++)
     {
     if ((ri->options[i].type & opt_mask) != opt_stringptr) continue;
     if (p == (char *)(r->options_block) + (long int)(ri->options[i].value))
@@ -508,11 +508,16 @@ for (r = routers; r != NULL; r = r->next)
 for (t = transports; t != NULL; t = t->next)
   {
   transport_info *ti = t->info;
-  for (i = 0; i < ti->options_count[0]; i++)
+  for (i = 0; i < *ti->options_count; i++)
     {
-    if ((ti->options[i].type & opt_mask) != opt_stringptr) continue;
-    if (p == (char *)(t->options_block) + (long int)(ti->options[i].value))
-      return US ti->options[i].name;
+    optionlist * op = &ti->options[i];
+    if ((op->type & opt_mask) != opt_stringptr) continue;
+    if (p == (  op->type & opt_public
+            ? (char *)t
+            : (char *)t->options_block
+            )
+            + (long int)op->value)
+       return US op->name;
     }
   }