X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/b8514d1960e259d49ab2c84c89eba52ab993da3f..8f2cf8f5adaa08ef84b47bf9bc2f71e39236c22d:/src/src/search.c diff --git a/src/src/search.c b/src/src/search.c index 421d9c789..d93397f09 100644 --- a/src/src/search.c +++ b/src/src/search.c @@ -3,7 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2015 */ -/* Copyright (c) The Exim Maintainers 2020 */ +/* Copyright (c) The Exim Maintainers 2020 - 2021 */ /* See the file NOTICE for conditions of use and distribution. */ /* A set of functions to search databases in various formats. An open @@ -63,11 +63,9 @@ Returns: +ve => valid lookup name; value is offset in lookup_list */ int -search_findtype(const uschar *name, int len) +search_findtype(const uschar * name, int len) { -int bot = 0; -int top = lookup_list_count; -while (top > bot) +for (int bot = 0, top = lookup_list_count; top > bot; ) { int mid = (top + bot)/2; int c = Ustrncmp(name, lookup_list[mid]->name, len); @@ -92,7 +90,7 @@ while (top > bot) if (c > 0) bot = mid + 1; else top = mid; } -search_error_message = string_sprintf("unknown lookup type \"%.*s\"",len,name); +search_error_message = string_sprintf("unknown lookup type \"%.*s\"", len, name); return -1; } @@ -619,8 +617,8 @@ else e->data.ptr = data; } - /* If caching was disabled, empty the cache tree. We just set the cache - pointer to NULL here, because we cannot release the store at this stage. */ +/* If caching was disabled, empty the cache tree. We just set the cache +pointer to NULL here, because we cannot release the store at this stage. */ else {