diff --git a/du4/program b/du4/program index a63b52e..bc664ef 100755 Binary files a/du4/program and b/du4/program differ diff --git a/du4/program.c b/du4/program.c index 861b6ee..b1e9589 100644 --- a/du4/program.c +++ b/du4/program.c @@ -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) {