Well you posted incorrect code twice now, so how about posting the results from Dave's code?

Or repost your latest effort.

Because isdigit() is for '0' to '9', not 4 or 123 or any other integer value you get.