diff libcoding/hexout.c @ 1:13518c86b73c

libcoding: add hexout.c, implementing emit_hex_out()
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 05 Aug 2023 02:06:14 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libcoding/hexout.c	Sat Aug 05 02:06:14 2023 +0000
@@ -0,0 +1,17 @@
+/*
+ * The function implemented in this module emits hex bytes to a stdio output.
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+
+emit_hex_out(buf, buflen, outf)
+	u_char *buf;
+	unsigned buflen;
+	FILE *outf;
+{
+	unsigned n;
+
+	for (n = 0; n < buflen; n++)
+		fprintf(outf, "%02X", buf[n]);
+}