summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorGravatar BALATON Zoltan2014-10-08 01:59:36 +0200
committerGravatar BALATON Zoltan2014-10-21 01:15:01 +0200
commit5ae84edb11f119120d57e649bc218a565a247087 (patch)
tree8b653a395957f98b3cee7699d316d1e610e0bab9 /src/common.c
parent2d1cb444b1227787eebe29b11a04b190c1b5adf6 (diff)
downloadidevicerestore-5ae84edb11f119120d57e649bc218a565a247087.tar.gz
idevicerestore-5ae84edb11f119120d57e649bc218a565a247087.tar.bz2
Supress printing very long plists and too verbose messages in debug output
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index 49df778..f889087 100644
--- a/src/common.c
+++ b/src/common.c
@@ -30,6 +30,8 @@
#include "common.h"
+#define MAX_PRINT_LEN 64*1024
+
int idevicerestore_debug = 0;
#define idevicerestore_err_buff_size 256
@@ -186,7 +188,10 @@ void debug_plist(plist_t plist) {
uint32_t size = 0;
char* data = NULL;
plist_to_xml(plist, &data, &size);
- info("%s", data);
+ if (size <= MAX_PRINT_LEN)
+ info("%s:printing %i bytes plist:\n%s", __FILE__, size, data);
+ else
+ info("%s:supressed printing %i bytes plist...\n", __FILE__, size);
free(data);
}