view libutil/nibbles2asc.c @ 161:884b93362449

libutil: nibbles_to_ascii() function implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 26 Feb 2021 21:10:26 +0000
parents
children
line wrap: on
line source

/*
 * This module implements a function for turning a nibble array
 * into printable ASCII.
 */

#include <sys/types.h>

void
nibbles_to_ascii(nib, len, out)
	u_char *nib;
	unsigned len;
	char *out;
{
	unsigned n;

	for (n = 0; n < len; n++)
		*out++ = encode_hex_digit(*nib++);
	*out = '\0';
}