|
|
|
@ -23,15 +23,8 @@ static void parse_hex(FILE *fp, char *buf, size_t len) |
|
|
|
|
for (i = 0; i < len; ++i) { |
|
|
|
|
memset(s, '\0', 3); |
|
|
|
|
|
|
|
|
|
while ((s[0] = getc(fp)) && !isxdigit(s[0])) |
|
|
|
|
putchar(s[0]); |
|
|
|
|
|
|
|
|
|
putchar(s[0]); |
|
|
|
|
|
|
|
|
|
while ((s[1] = getc(fp)) && !isxdigit(s[1])) |
|
|
|
|
putchar(s[1]); |
|
|
|
|
|
|
|
|
|
putchar(s[1]); |
|
|
|
|
while ((s[0] = getc(fp)) && !isxdigit(s[0])); |
|
|
|
|
while ((s[1] = getc(fp)) && !isxdigit(s[1])); |
|
|
|
|
|
|
|
|
|
*buf++ = strtoul(s, NULL, 16); |
|
|
|
|
} |
|
|
|
|