summaryrefslogtreecommitdiffstats
path: root/src/tests/dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/dump.c')
-rw-r--r--src/tests/dump.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/dump.c b/src/tests/dump.c
new file mode 100644
index 0000000000..32303ace81
--- /dev/null
+++ b/src/tests/dump.c
@@ -0,0 +1,34 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/mit-copyright.h>.
+ *
+ * Dump out a krb5_data to stderr (for debugging purposes).
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_dump_c[] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+
+#include <stdio.h>
+
+#include <krb5/krb5.h>
+
+void dump_data (data)
+ krb5_data *data;
+{
+ unsigned char *ptr = (unsigned char *)data->data;
+ int i;
+ for (i=0; i<data->length; i++) {
+ fprintf(stderr, "%02x ", ptr[i]);
+ if ((i % 16) == 15) fprintf(stderr, "\n");
+ }
+ fprintf(stderr, "\n");
+}