patch-1.3.31 linux/arch/i386/kernel/hexify.c

Next file: linux/arch/i386/kernel/irq.c
Previous file: linux/arch/i386/kernel/head.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.30/linux/arch/i386/kernel/hexify.c linux/arch/i386/kernel/hexify.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+
+void main()
+{
+	int c;
+	int comma=0;
+	int count=0;
+	while((c=getchar())!=EOF)
+	{
+		unsigned char x=c;
+		if(comma)
+			printf(",");
+		else
+			comma=1;
+		if(count==8)
+		{
+			count=0;
+			printf("\n");
+		}
+		if(count==0)
+			printf("\t");
+		printf("0x%02X",c);
+		count++;
+	}
+	if(count)
+		printf("\n");
+	exit(0);
+}
+
+		

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this