Fixed the getNumberArg issue, which is what was causing so much headache.

Multiplier variable not set correctly.
+- metadataops.c
+- sim02
This commit is contained in:
Charles Descamps 2024-02-28 10:23:25 -07:00
parent 5a747ab1dd
commit 02cb8b33e6
2 changed files with 3 additions and 3 deletions

View file

@ -545,16 +545,16 @@ int getNumberArg(int *number, const char *inputStr, int index)
index = index + 1; index = index + 1;
} }
// loop across string length // loop across string length
while(isDigit(inputStr[index]) == true && while(isDigit(inputStr[index]) &&
inputStr[index] != NULL_CHAR) inputStr[index] != NULL_CHAR)
{ {
// set digit found flag // set digit found flag
foundDigit = true; foundDigit = true;
// assign digit to output // assign digit to output
(*number) = (*number) * multiplier + inputStr[index] - '0'; (*number) = (*number) * multiplier + (inputStr[index] - '0');
// increment index and multiplier // increment index and multiplier
index = index + 1; index = index + 1;
multiplier = multiplier + 1; multiplier = 10;
} }
// check for digit not found // check for digit not found
if(!foundDigit) if(!foundDigit)

Binary file not shown.