From 3daa8369c78cde9f4630bae7d5328cc974d349e5 Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 11 Mar 2015 17:52:11 -0700 Subject: [PATCH] allow XTOUPPER to work with macros that don't like signed types --- wolfcrypt/src/integer.c | 2 +- wolfcrypt/src/tfm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index e3c00444b..b68ec7ea7 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -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; diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 8ac48323a..54bce6ac9 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -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;