brcc
This commit is contained in:
parent
c513d24ba7
commit
fc2c35654b
BIN
du4/program
BIN
du4/program
Binary file not shown.
@ -64,6 +64,12 @@ int main(){
|
||||
}
|
||||
} else if (scanStatus == SCAN_RESULT) {
|
||||
retVal = scanValue(currentChar, &c);
|
||||
|
||||
if (endChar - retVal > sizeof(char)) {
|
||||
error();
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
error();
|
||||
|
||||
@ -75,6 +81,12 @@ int main(){
|
||||
|
||||
break;
|
||||
} else if (scanStatus == SCAN_RESULT) {
|
||||
if (operator == '/' && b == 0) {
|
||||
error();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
bool validResult = evaluate(a, b, c, operator);
|
||||
|
||||
if (validResult == true) {
|
||||
|
Loading…
Reference in New Issue
Block a user