-/* Convert ASCII hex string to integer. */
-int
-asciihex2int(char *str)
-{
- int val;
- int rc;
-
- rc = sscanf(str, "%X", &val);
-
- if (rc == 0) {
- log_err("ASCII to hex conversion failure");
- asciihex2int_error = true;
- }
-
- return val;
-}
-
-/* Convert an ascii string to an hexadecimal number. */
+/*
+ * Convert ASCII string in hexadecimal notation to integer, up to length
+ * characters.
+ * The string contains only [0-9] and [a-f] characters (no "0x" prefix).
+ */