No problemo, if we stop answering your questions you know it's too fussy. Here's something you can try. Check all characters in your buffer with the isdigit function (but not the last character because this is the newline character).
Originally posted by lockpatrick
Sorry for being so fussy.
int main ( void )
unsigned int i;
printf ( "Enter a number: " );
if ( fgets ( buffer, sizeof buffer, stdin ) != NULL )
/* watch out for the ';' at the end of the next line (for) */
for(i = 0; (i < strlen(buffer)-1) && isdigit(buffer[i]); i++) ;
if(i == strlen(buffer)-1)
printf ( "%d\n", atoi ( buffer ) );
printf ( "Error: Input validation\n" );