diff --git a/cv3/program.c b/cv3/program.c index 14095c4..fdc3c32 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -21,6 +21,10 @@ int main(){ return 0; } if(vstup[0] == '-' || vstup[0] == '+' || vstup[0] == '*' || vstup[0] == '/'){ + if(counter < 2){ + printf("not enough operands\n"); + return 0; + } if(vstup[0] == '-'){ mystack.values[counter-2] = mystack.values[counter-2] - mystack.values[counter-1]; mystack.values[counter-1] = 0;