I believe this
Code:
if( isdigit(action[i])>1)
is not what you want. (I would not expect isdigit to ever return something bigger than 1, although it is theoretically possible.) You probably just want isdigit by itself.
Anyway, if you feel the need to not use
Code:
sscanf(action+wordsize, "%d", &first_number);
but want to read in character by character, you can do so: as you read in a digit, multiply what you have by 10 and add in the value of the new digit.
And excitingly, you can use %n to find out how many characters were read by sscanf, so that you can work out the new position (as in my example above).