X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fconvert-conf.c;h=2e103eacf05c8b0d17c0ca8428ec3d7d89a81d80;hb=refs%2Fheads%2Fupstream;hp=da88adb9b5da54cc18dcaa1520235bd16187f08c;hpb=d843a56e1efb9cafe685bb72702a10e8f8d1bde7;p=ircu2.10.12-pk.git diff --git a/ircd/convert-conf.c b/ircd/convert-conf.c index da88adb..2e103ea 100644 --- a/ircd/convert-conf.c +++ b/ircd/convert-conf.c @@ -100,7 +100,7 @@ static void simple_line(const char *block, const char **names, const char *extra fputs("};\n", stdout); } -#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE); (TARGET) = malloc(len+1); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0) +#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE) + 1; (TARGET) = malloc(len); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0) /*** MANAGING LISTS OF STRINGS ***/ @@ -213,12 +213,11 @@ static void finish_connects(void) { for (sl = conn->origins; sl; sl = sl->next) fprintf(stdout, "# %s\n", sl->value); - if (conn->name == NULL - || conn->host == NULL + if (conn->host == NULL || conn->password == NULL || conn->class == NULL) { - fprintf(stderr, "H:line missing C:line for %s\n",sl->value); + fprintf(stderr, "H:line missing C:line for %s\n", conn->name); continue; } @@ -354,6 +353,14 @@ static void finish_features(void) continue; } + /* If it had no value before, drop it now since the lexer does + * not accept empty strings and the grammar does not accept + * empty stringlists.*/ + if (!feat->values) { + fprintf(stdout, "# Above feature had no value.\n"); + continue; + } + /* Wasn't remapped, wasn't removed: print it out. */ fprintf(stdout, "\t\"%s\" =", feat->name); for (sl = feat->values; sl; sl = sl->next)