logical operators in C C+ K&R (Polish Reverse Calculator) : 
     int getop(char s[])
     {
	   int i, c;

	   while ((s[0] = c = getch()) == ' ' || c == '\t')
		  ;
	   s[1] = '\0';
	   i = 0;
	   if (isalpha(c))				//math function found.
	   {
	    	while (isalpha(s[++i] = c = getch()))
		    	;
	  	   s[i] = '\0';
		   if (c != 'EOF')
			  ungetch(c);
		   return MATHLIB;
	   }
	   if ((c != '.'&&c != '-') &&!isdigit(c))	   /*operand found*/
		   return c;
	   if (c == '-')
	   {
		   if (!isdigit(c = getch()))
		   {
			   ungetch(c);
			   return '-';
		   }
		   else
		   {
			   ungetch(c);
		   }
	   }
	   if (isdigit(c))				 /*number found*/
	   {                            
		   {
			   while (isdigit(s[++i] = c = getch()))
				   ;
		   }
		   if (c == '.')
		   {
			   while (isdigit(s[++i] = c = getch()))
				   ;
		   }
		   s[i] = '\0';
		   if (c != EOF)
			   ungetch(c);
		   return NUMBER;
	   }
	
    }  


This is part of my Reverse Polish Calculator code, which is in working order.
Problem is, I tried to change the line

    if ((c != '.'&&c != '-') &&!isdigit(c))     /*operand found*/
to

    if ((c != '.'&&c != '-') && (c == '+' || c == '*' || c == '/' || c == '%'))

And even though I thought it was going to work correctly,
It didn't at all.
The switch function in main() won't catch operators at all.
On top of it, every return value was going to default: printf("error");

I don't understand why it didn't work and it bothers me.
Any advice?