/* Parse a hexadecimal encoded character starting at index i in string s. The resulting character will be returned and the index i will be updated to point at the character directly after the end of the encoding, this may be the '\0' terminator of the string.  */
static char get_hex_char(const char *s, int *i)
/* Parse a hexadecimal encoded character starting at index i in string s. The resulting character will be returned and the index i will be updated to point at the character directly after the end of the encoding, this may be the '\0' terminator of the string.  */
static char get_hex_char(const char *s, int *i)
{
	char x[3];
	char *endx;
	long val;
	x[2] = '\0';
	strncpy(x, s + *i, 2);
	val = strtol(x, &endx, 16);
	if (!(endx  > x))
		die("\\x used with no following hex digits\n");
	(*i) += endx - x;
	return val;
}