Smaller-type check fixed
This commit is contained in:
parent
385986f704
commit
7510410b56
@ -144,13 +144,13 @@ namespace winstd
|
|||||||
|
|
||||||
int x = data[i];
|
int x = data[i];
|
||||||
if ('0' <= x && x <= '9') {
|
if ('0' <= x && x <= '9') {
|
||||||
buf = (buf << 4) | (unsigned char)(x - '0');
|
buf = ((buf & 0xf) << 4) | (unsigned char)(x - '0');
|
||||||
num++;
|
num++;
|
||||||
} else if ('A' <= x && x <= 'F') {
|
} else if ('A' <= x && x <= 'F') {
|
||||||
buf = (buf << 4) | (unsigned char)(x - ('A' - 10));
|
buf = ((buf & 0xf) << 4) | (unsigned char)(x - ('A' - 10));
|
||||||
num++;
|
num++;
|
||||||
} else if ('a' <= x && x <= 'f') {
|
} else if ('a' <= x && x <= 'f') {
|
||||||
buf = (buf << 4) | (unsigned char)(x - ('a' - 10));
|
buf = ((buf & 0xf) << 4) | (unsigned char)(x - ('a' - 10));
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user