diff options
author | BALATON Zoltan | 2014-10-22 22:59:47 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-10-26 14:17:43 +0100 |
commit | 8dc5f5ad7f04a2c2d1d31852f24f9e5bac4a9a53 (patch) | |
tree | a99643193655a3ee46d45581f146a0a4bf167e29 | |
parent | 2f32ff99f90689b364b86d4c12f3a1b8b318991e (diff) | |
download | libimobiledevice-8dc5f5ad7f04a2c2d1d31852f24f9e5bac4a9a53.tar.gz libimobiledevice-8dc5f5ad7f04a2c2d1d31852f24f9e5bac4a9a53.tar.bz2 |
Supress printing very long plists in debug output
-rw-r--r-- | common/debug.c | 8 |
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 } |