One quick problem you have is that you're running past the end of your array. Consider:
Valid entried in the above array are:
Code:
array[0] = something;
array[1] = something;
The following is invalid, as it goes beyond the end of your array, and into memory that you do not rightly have access to tinker with:
Code:
array[2] = BadThings( TM );
How this ties into your code should now be apparent:
Code:
char buffer[USERNBR_LEN + NULL_SIZE];
...snip
/* grab the USERNBR to test */
strncpy(buffer, input.usernbr, USERNBR_LEN);
buffer[USERNBR_LEN + NULL_SIZE] = '\0';
See there? You are accessing the space just past the end of the array. The only valid cells are zero to declaration size minus one.
Thus, you can only use:
Code:
buffer[0] ... buffer[USERNBR_LEN + NULL_SIZE -1]
Now on to your original problem...
Read until you encounter a number. Then read until you don't encounter any more numbers. From that point on, if anything that isn't a space shows up, you don't have valid input. Otherwise if you reach the end of the string, you do.
Quzah.