X-Git-Url: http://git.asbjorn.biz/?p=debian%2Fdhcpd-pools.git;a=blobdiff_plain;f=src%2Fgetdata.c;h=133485583e462d4f6f1e8f614d0b5eaed6a10524;hp=c25d87ef10cef09c0442af9db58b33a9148e515d;hb=b492802dfa7bf928bbafe74194ca4f154c70f743;hpb=a10396710e32659e82032b84a5468be52c3996d5 diff --git a/src/getdata.c b/src/getdata.c index c25d87e..1334855 100644 --- a/src/getdata.c +++ b/src/getdata.c @@ -386,9 +386,14 @@ char *parse_config(int is_include, char *config_file, range_p->backups = 0; range_p->shared_net = shared_p; num_ranges++; - if (RANGES < num_ranges) { - errx(EXIT_FAILURE, - "parse_config: Range space full! Increase RANGES and recompile."); + if (RANGES < num_ranges + 1) { + RANGES *= 2; + ranges = + safe_realloc(ranges, + sizeof(struct + range_t) * + RANGES); + range_p = ranges + num_ranges; } newclause = true; break; @@ -427,7 +432,15 @@ char *parse_config(int is_include, char *config_file, * away by reallocationg * more space. */ errx(EXIT_FAILURE, - "parse_config: End of shared-network space, increase SHARED_NETWORKS_NAMES and recompile"); + "parse_config: increase default.h SHARED_NETWORKS_NAMES and recompile"); + } + if (SHARED_NETWORKS < + num_shared_networks + 2) { + /* FIXME: make this + * away by reallocationg + * more space. */ + errx(EXIT_FAILURE, + "parse_config: increase default.h SHARED_NETWORKS and recompile"); } argument = 0; braces_shared = braces;