X-Git-Url: http://git.asbjorn.it/?p=debian%2Fdhcpd-pools.git;a=blobdiff_plain;f=src%2Fgetdata.c;h=2fc1f5f6a4738fda3e158ecbd78058d9eb2ee912;hp=03566497fc2901f35d2d1da9d74868d13c542915;hb=ee35f8bb1f94b177675ab84b963a0fe61cd201eb;hpb=e6c32dbdf9d0a0c685f5c402f94e965cf587f062 diff --git a/src/getdata.c b/src/getdata.c index 0356649..2fc1f5f 100644 --- a/src/getdata.c +++ b/src/getdata.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 2006- Sami Kerola < > +** Copyright (C) 2006- Sami Kerola ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -146,9 +146,9 @@ int parse_leases(void) }; } - if ((num_leases > leasesmallocsize) || - (num_touches > touchesmallocsize) || - (num_backups > backupsmallocsize)) { + if ((leasesmallocsize < num_leases) || + (touchesmallocsize < num_touches) || + (backupsmallocsize < num_backups)) { printf("WARNING: running out of memory\n"); printf("\tlease/touch/backup = %lu/%lu/%lu\n", leasesmallocsize, touchesmallocsize, @@ -350,7 +350,7 @@ char *parse_config(int is_include, char *config_file, i++; /* Long word which is almost causing overflow. Not any of words * this program is looking for are this long. */ - if (i > MAXLEN) { + if (MAXLEN < i) { newclause = false; i = 0; continue; @@ -414,7 +414,7 @@ char *parse_config(int is_include, char *config_file, range_p->backups = 0; range_p->shared_net = shared_p; num_ranges++; - if (num_ranges > RANGES) { + if (RANGES < num_ranges) { eprintf ("parse_config: Range space full! Increase RANGES and recompile."); exit(EXIT_FAILURE); @@ -435,7 +435,8 @@ char *parse_config(int is_include, char *config_file, /* printf ("include file: %s\n", word); */ argument = 0; next_free_shared_name = - parse_config(false, word, current_shared_name, + parse_config(false, word, + current_shared_name, next_free_shared_name, shared_p); newclause = true;