return 1;
for(i = 0; i < hexcnt; i += 2) {
- if (!(isxdigit(line[bg + i]) && isxdigit(line[bg + i + 1])) ) return 1;
+ if (!(isxdigit((unsigned char)line[bg + i]) && isxdigit((unsigned char)line[bg + i + 1])) ) return 1;
sscanf((char[]){line[bg + i], line[bg + i + 1], 0}, "%X", &temp);
data[i / 2] = temp & 0xff;
return 1;
for(i = 0; i < *hexcnt; i += 2) {
- if (!(isxdigit(line[bg + i]) && isxdigit(line[bg + i + 1])) ) return 1;
+ if (!(isxdigit((unsigned char)line[bg + i]) && isxdigit((unsigned char)line[bg + i + 1])) ) return 1;
sscanf((char[]){line[bg + i], line[bg + i + 1], 0}, "%X", &temp);
data[i / 2] = temp & 0xff;
continue;
}
- if (isxdigit(line[indx])) {
+ if (isxdigit((unsigned char)line[indx])) {
buf[strlen(buf) + 1] = 0x00;
buf[strlen(buf)] = line[indx];
} else {
else if (x >= 'A' && x <= 'F')
x -= 'A' - 10;
else {
- printf("Discovered unknown character %c %d at idx %d of %s\n", x, x, source - start, start);
+ printf("Discovered unknown character %c %d at idx %tu of %s\n", x, x, source - start, start);
return 0;
}
// output