diff --git a/cv3/program.c b/cv3/program.c index a8a5363..5c21ecc 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -107,12 +107,13 @@ int main(int argc, char const *argv[]) } else { - if(calculate(&calc_stack, buf[0]) == 1) + int calc_code = calculate(&calc_stack, buf[0]); + if(calc_code == 1) { printf("division by zero\n"); return 0; } - else if(calculate(&calc_stack, buf[0]) == 2) + else if(calc_code == 2) { printf("not enough operands\n"); return 0;