comparison uptools/libcoding/hexdecode2.c @ 966:ec7e23d5151f

fcup-smsend: add support for backslash escapes, new -e option
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 01 Sep 2023 15:44:52 +0000
parents
children
comparison
equal deleted inserted replaced
965:2969032bdfac 966:ec7e23d5151f
1 /*
2 * This module is a subset of hexdigits.c from fc-sim-tools/libutil.
3 */
4
5 decode_hex_digit(c)
6 {
7 if (c >= '0' && c <= '9')
8 return(c - '0');
9 if (c >= 'A' && c <= 'F')
10 return(c - 'A' + 10);
11 if (c >= 'a' && c <= 'f')
12 return(c - 'a' + 10);
13 return(-1);
14 }