diff options
| author | 2014-10-22 22:59:47 +0200 | |
|---|---|---|
| committer | 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 @@ | |||
| 39 | #include "asprintf.h" | 39 | #include "asprintf.h" |
| 40 | #endif | 40 | #endif |
| 41 | 41 | ||
| 42 | #define MAX_PRINT_LEN 16*1024 | ||
| 43 | |||
| 42 | int debug_level = 0; | 44 | int debug_level = 0; |
| 43 | 45 | ||
| 44 | /** | 46 | /** |
| @@ -163,7 +165,11 @@ void debug_plist_real(const char *func, const char *file, int line, plist_t plis | |||
| 163 | if (buffer[length-1] == '\n') | 165 | if (buffer[length-1] == '\n') |
| 164 | buffer[length-1] = '\0'; | 166 | buffer[length-1] = '\0'; |
| 165 | 167 | ||
| 166 | debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer); | 168 | if (length <= MAX_PRINT_LEN) |
| 169 | debug_info_real(func, file, line, "printing %i bytes plist:\n%s", length, buffer); | ||
| 170 | else | ||
| 171 | debug_info_real(func, file, line, "supress printing %i bytes plist...\n", length); | ||
| 172 | |||
| 167 | free(buffer); | 173 | free(buffer); |
| 168 | #endif | 174 | #endif |
| 169 | } | 175 | } |
