comparison libutil/nibbles2asc.c @ 8:34bbb0585cab

libutil: import from previous fc-pcsc-tools version
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Mar 2021 05:42:37 +0000
parents
children
comparison
equal deleted inserted replaced
7:b25d4dfe5798 8:34bbb0585cab
1 /*
2 * This module implements a function for turning a nibble array
3 * into printable ASCII.
4 */
5
6 #include <sys/types.h>
7
8 void
9 nibbles_to_ascii(nib, len, out)
10 u_char *nib;
11 unsigned len;
12 char *out;
13 {
14 unsigned n;
15
16 for (n = 0; n < len; n++)
17 *out++ = encode_hex_digit(*nib++);
18 *out = '\0';
19 }