allow XTOUPPER to work with macros that don't like signed types

This commit is contained in:
toddouska 2015-03-11 17:52:11 -07:00
parent b02622d1d0
commit 3daa8369c7
2 changed files with 2 additions and 2 deletions

View File

@ -4454,7 +4454,7 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
* this allows numbers like 1AB and 1ab to represent the same value
* [e.g. in hex]
*/
ch = (char) ((radix < 36) ? XTOUPPER(*str) : *str);
ch = (char) ((radix < 36) ? XTOUPPER((unsigned char)*str) : *str);
for (y = 0; y < 64; y++) {
if (ch == mp_s_rmap[y]) {
break;

View File

@ -2478,7 +2478,7 @@ static int fp_read_radix(fp_int *a, const char *str, int radix)
* this allows numbers like 1AB and 1ab to represent the same value
* [e.g. in hex]
*/
ch = (char) ((radix < 36) ? XTOUPPER(*str) : *str);
ch = (char) ((radix < 36) ? XTOUPPER((unsigned char)*str) : *str);
for (y = 0; y < 64; y++) {
if (ch == fp_s_rmap[y]) {
break;