FreeCalypso > hg > fc-pcsc-tools
comparison 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 |
comparison
equal
deleted
inserted
replaced
160:b86b3f8890ba | 161:884b93362449 |
---|---|
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 } |