1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 16:43:12 +02:00

Fixed a bug in the binary searching routines

This commit is contained in:
codemastr
2002-12-29 17:34:51 +00:00
parent 2270e37dca
commit efa61e7ec0
2 changed files with 6 additions and 2 deletions
+2
View File
@@ -1747,3 +1747,5 @@ seen. gmtime warning still there
h. (#0000556)
- Added a pretty_time_val function, this converts a number such as 86400 to "1 day"
to make it easier to read.
- Fixed a bug in the binary search functions that could cause crashes when unknown config
directives were added. Reported by 1of10 (#0000587)
+4 -2
View File
@@ -947,7 +947,7 @@ void config_progress(char *format, ...)
ConfigCommand *config_binary_search(char *cmd) {
int start = 0;
int stop = sizeof(_ConfigCommands)/sizeof(_ConfigCommands[0]);
int stop = sizeof(_ConfigCommands)/sizeof(_ConfigCommands[0])-1;
int mid;
while (start <= stop) {
mid = (start+stop)/2;
@@ -1556,10 +1556,11 @@ int config_run()
OperFlag *config_binary_flags_search(OperFlag *table, char *cmd, int size) {
int start = 0;
int stop = size;
int stop = size-1;
int mid;
while (start <= stop) {
mid = (start+stop)/2;
if (smycmp(cmd,table[mid].name) < 0) {
stop = mid-1;
}
@@ -4164,6 +4165,7 @@ int _test_log(ConfigFile *conf, ConfigEntry *ce) {
config_error("%s:%i: unknown log flag '%s'",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum,
cepp->ce_varname);
errors++;
}
}