view libutil/nibbles2asc.c @ 98:2972f00622c7

scripts/fcsim1-defprog: clear the upper bits of the mystery byte following Grcard's official "personalization" script
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 05 May 2021 04:15:15 +0000
parents 34bbb0585cab
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';
}