cases to introduce arguments, whereas for other it is part of the name. This is
an historical mis-design. */
-static uschar *op_table_underscore[] = {
+static uschar * op_table_underscore[] = {
US"from_utf8",
US"local_part",
US"quote_local_part",
else
{
int n;
- uschar *opt = Ustrchr(arg, '_');
+ uschar * opt = Ustrchr(arg, '_');
if (opt) *opt++ = 0;
static inline dns_answer *
store_get_dns_answer_trc(const uschar * func, unsigned line)
{
-/* return store_get_3(sizeof(dns_answer), TRUE, CCS func, line); use tainted mem */
return store_malloc_3(sizeof(dns_answer), CCS func, line);
}
*/
static uschar *
-mysql_quote(uschar *s, uschar *opt)
+mysql_quote(uschar * s, uschar * opt)
{
register int c;
int count = 0;
uschar *t = s;
uschar *quoted;
-if (opt != NULL) return NULL; /* No options recognized */
+if (opt) return NULL; /* No options recognized */
-while ((c = *t++) != 0)
+while ((c = *t++))
if (Ustrchr("\n\t\r\b\'\"\\", c) != NULL) count++;
if (count == 0) return s;
t = quoted = store_get(Ustrlen(s) + count + 1, is_tainted(s));
-while ((c = *s++) != 0)
+while ((c = *s++))
{
if (Ustrchr("\n\t\r\b\'\"\\", c) != NULL)
{
*t++ = '\\';
switch(c)
{
- case '\n': *t++ = 'n';
- break;
- case '\t': *t++ = 't';
- break;
- case '\r': *t++ = 'r';
- break;
- case '\b': *t++ = 'b';
- break;
- default: *t++ = c;
- break;
+ case '\n': *t++ = 'n'; break;
+ case '\t': *t++ = 't'; break;
+ case '\r': *t++ = 'r'; break;
+ case '\b': *t++ = 'b'; break;
+ default: *t++ = c; break;
}
}
else *t++ = c;
*/
static uschar *
-pgsql_quote(uschar *s, uschar *opt)
+pgsql_quote(uschar * s, uschar * opt)
{
-register int c;
-int count = 0;
-uschar *t = s;
-uschar *quoted;
+int count = 0, c;
+uschar * t = s, * quoted;
-if (opt != NULL) return NULL; /* No options recognized */
+if (opt) return NULL; /* No options recognized */
-while ((c = *t++) != 0)
+while ((c = *t++))
if (Ustrchr("\n\t\r\b\'\"\\", c) != NULL) count++;
if (count == 0) return s;
t = quoted = store_get(Ustrlen(s) + count + 1, is_tainted(s));
-while ((c = *s++) != 0)
+while ((c = *s++))
{
if (c == '\'')
{
*t++ = '\\';
switch(c)
{
- case '\n': *t++ = 'n';
- break;
- case '\t': *t++ = 't';
- break;
- case '\r': *t++ = 'r';
- break;
- case '\b': *t++ = 'b';
- break;
- default: *t++ = c;
- break;
+ case '\n': *t++ = 'n'; break;
+ case '\t': *t++ = 't'; break;
+ case '\r': *t++ = 'r'; break;
+ case '\b': *t++ = 'b'; break;
+ default: *t++ = c; break;
}
}
else *t++ = c;
*/
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);
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;
}
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
{
*/
void *
-store_get_perm_3(int size, BOOL tainted, const char *func, int linenumber)
+store_get_perm_3(int size, BOOL tainted, const char * func, int linenumber)
{
-void *yield;
+void * yield;
int old_pool = store_pool;
store_pool = POOL_PERM;
yield = store_get_3(size, tainted, func, linenumber);