summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/debug.c29
-rw-r--r--src/src/functions.h2
2 files changed, 16 insertions, 15 deletions
diff --git a/src/src/debug.c b/src/src/debug.c
index 3cd6d0c92..ee284d0be 100644
--- a/src/src/debug.c
+++ b/src/src/debug.c
@@ -152,33 +152,22 @@ void
debug_printf_indent(const char * format, ...)
{
va_list ap;
-unsigned depth = acl_level + expand_level, i;
-
-if (!debug_file) return;
-if (depth > 0)
- {
- for (i = depth >> 2; i > 0; i--)
- fprintf(debug_file, " .");
- fprintf(debug_file, "%*s", depth & 3, "");
- }
-
va_start(ap, format);
-debug_vprintf(format, ap);
+debug_vprintf(acl_level + expand_level, format, ap);
va_end(ap);
}
-
void
debug_printf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
-debug_vprintf(format, ap);
+debug_vprintf(0, format, ap);
va_end(ap);
}
void
-debug_vprintf(const char *format, va_list ap)
+debug_vprintf(int indent, const char *format, va_list ap)
{
int save_errno = errno;
@@ -217,6 +206,18 @@ if (debug_ptr == debug_buffer)
debug_prefix_length = debug_ptr - debug_buffer;
}
+if (indent > 0)
+ {
+ int i;
+ for (i = indent >> 2; i > 0; i--)
+ {
+ Ustrcpy(debug_ptr, " .");
+ debug_ptr += 4;
+ }
+ Ustrncpy(debug_ptr, " ", indent & 3);
+ debug_ptr += indent & 3;
+ }
+
/* Use the checked formatting routine to ensure that the buffer
does not overflow. Ensure there's space for a newline at the end. */
diff --git a/src/src/functions.h b/src/src/functions.h
index a0ab39e17..2ff6017d8 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -135,7 +135,7 @@ extern void debug_print_ids(uschar *);
extern void debug_printf_indent(const char *, ...) PRINTF_FUNCTION(1,2);
extern void debug_print_string(uschar *);
extern void debug_print_tree(tree_node *);
-extern void debug_vprintf(const char *, va_list);
+extern void debug_vprintf(int, const char *, va_list);
extern void decode_bits(unsigned int *, size_t, int *,
uschar *, bit_table *, int, uschar *, int);
extern address_item *deliver_make_addr(uschar *, BOOL);