summaryrefslogtreecommitdiffstats
path: root/collection
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2012-03-26 17:41:19 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-04-05 11:20:09 -0700
commit12c8a2748fb47168e19e2600772fea46b73eebed (patch)
tree423396c5b4ad53103635f341a5f985dd02110c9d /collection
parentfb03c1c48d0df64aba93aa69c59081dccc7d7c35 (diff)
downloadding-libs2-12c8a2748fb47168e19e2600772fea46b73eebed.tar.gz
ding-libs2-12c8a2748fb47168e19e2600772fea46b73eebed.tar.xz
ding-libs2-12c8a2748fb47168e19e2600772fea46b73eebed.zip
Do not debug padding
The header structure might contain padding to align data on the boundary of the word. It is unsafe to always print the header data as it might be uninitialized. I do not want to remove it as it might be handy some day so I prefer to #ifdef it.
Diffstat (limited to 'collection')
-rw-r--r--collection/collection_tools.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/collection/collection_tools.c b/collection/collection_tools.c
index 7352b3a..b7f30d2 100644
--- a/collection/collection_tools.c
+++ b/collection/collection_tools.c
@@ -129,8 +129,11 @@ int col_debug_handle(const char *property,
((struct collection_header *)(data))->count,
((struct collection_header *)(data))->reference_count,
((struct collection_header *)(data))->cclass);
+/* Due to padding issues this is unsafe so ifdefed for now */
+#ifdef COL_PRINT_BINARY_HEADER
for (i = 0; i < length; i++)
printf("%02X", ((unsigned char *)(data))[i]);
+#endif
printf(" (%d)\n", nest_level);
break;
case COL_TYPE_COLLECTIONREF: