X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/09fbf4d0a21c9cad25cc3f12b1e3f365f850eb94..db0e70a131f1a3a28cc78cface5b5db87b0d5416:/codec/baseconv.c diff --git a/codec/baseconv.c b/codec/baseconv.c index bdb850f..b7cb0a0 100644 --- a/codec/baseconv.c +++ b/codec/baseconv.c @@ -35,6 +35,7 @@ #include "alloc.h" #include "codec.h" #include "dstr.h" +#include "macros.h" #include "sub.h" #include "base64.h" @@ -279,7 +280,7 @@ enum { #define PUTWRAP(x) WRAP({ \ char ch = encodemap[x]; \ - if (f & CDCF_LOWERC) ch = tolower((unsigned char)ch); \ + if (f & CDCF_LOWERC) ch = TOLOWER(ch); \ DPUTC(d, ch); \ }) @@ -350,9 +351,9 @@ static int ctxn##_dodecode(ctxn##_ctx *ctx, \ case 0: \ break; \ case CDCF_LOWERC: \ - if (isupper(ch)) goto badch; \ + if (ISUPPER(ch)) goto badch; \ default: \ - ch = toupper(ch); \ + ch = TOUPPER(ch); \ } \ x = decodemap[ch]; \ switch (x) { \