summaryrefslogtreecommitdiffstats
path: root/common/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/debug.c')
-rw-r--r--common/debug.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/debug.c b/common/debug.c
index e497501..8ad0f08 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -39,6 +39,8 @@
#include "asprintf.h"
#endif
+#define MAX_PRINT_LEN 16*1024
+
int debug_level = 0;
/**
@@ -163,7 +165,11 @@ void debug_plist_real(const char *func, const char *file, int line, plist_t plis
if (buffer[length-1] == '\n')
buffer[length-1] = '\0';
- debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer);
+ if (length <= MAX_PRINT_LEN)
+ debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer);
+ else
+ debug_info_real(func, file, line, "supress printing %i bytes plist...\n", length);
+
free(buffer);
#endif
}