This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void hex2bin(unsigned char *to, const char *p, size_t len) { | |
| register char c1, c2; | |
| for (; *p; to++) { | |
| c1 = *p++; c2 = *p++; | |
| if (!c1 || !isxdigit(c1)) | |
| return; | |
| else if (!c2 || !isxdigit(c2)) | |
| *to = (unsigned char) digittoint(c1); | |
| else |