svn commit: samba r4027 - in branches/SAMBA_4_0/source/lib: .

metze at samba.org metze at samba.org
Wed Dec 1 16:51:37 GMT 2004


Author: metze
Date: 2004-12-01 16:51:37 +0000 (Wed, 01 Dec 2004)
New Revision: 4027

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4027

Log:
add a useful function for debugging

metze

Modified:
   branches/SAMBA_4_0/source/lib/data_blob.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/data_blob.c
===================================================================
--- branches/SAMBA_4_0/source/lib/data_blob.c	2004-12-01 11:35:01 UTC (rev 4026)
+++ branches/SAMBA_4_0/source/lib/data_blob.c	2004-12-01 16:51:37 UTC (rev 4027)
@@ -142,3 +142,21 @@
 	return False;
 }
 
+/*******************************************************************
+print the data_blob as hex string
+*******************************************************************/
+char *data_blob_hex_string(TALLOC_CTX *mem_ctx, DATA_BLOB *blob)
+{
+	int i;
+	char *hex_string;
+
+	hex_string = talloc_array_p(mem_ctx, char, (blob->length*2)+1);
+	if (!hex_string) {
+		return NULL;
+	}
+
+	for (i = 0; i < blob->length; i++)
+		slprintf(&hex_string[i*2], 3, "%02X", blob->data[i]);
+
+	return hex_string;
+}



More information about the samba-cvs mailing list