From bcac483b884cfd55aaa05e3e4e4f324daac1d972 Mon Sep 17 00:00:00 2001 From: Curtis F Kaylor Date: Fri, 27 Jul 2018 00:47:05 -0400 Subject: [PATCH] Fixed bug: lower case letters not recognized as hex digits --- src/parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parse.c b/src/parse.c index 2f4888d..a5d9bb9 100644 --- a/src/parse.c +++ b/src/parse.c @@ -15,7 +15,7 @@ /* Various tests against nxtchr */ int match(char c) {return TF(nxtchr == c);} -int inbtwn(char mn, char mx) {return TF(nxtchr >= mn && nxtchr <= mx);} +int inbtwn(char mn, char mx) {return TF(nxtupc >= mn && nxtupc <= mx);} int isalph(void) {return isalpha(nxtchr);} int isanum(void) {return isalnum(nxtchr);} int isapos(void) {return match('\'');} @@ -57,7 +57,7 @@ char getnxt(void) { //if (nxtwrd[nxtptr]) //If nxtwrd is set // nxtchr = nxtwrd[nxtptr++]; // Pop First Character from nxtwrd //else - nxtchr = fgetc(inpfil); + nxtchr = fgetc(inpfil); nxtupc = toupper(nxtchr); if (wascr && match('\n')) return c; //Skip NL after CR if (isnl()) curcol=1; else curcol++; @@ -232,7 +232,7 @@ int prshex(void) { DETAIL("%c", nxtchr); word[wrdlen++] = nxtchr; if (isdec()) digit = nxtchr - '0'; - else digit = nxtchr - 'A' + 10; + else digit = nxtupc - 'A' + 10; number = number * 16 + digit; skpchr(); }