Custom Made Safe Input Function

This is a discussion on Custom Made Safe Input Function within the C Programming forums, part of the General Programming Boards category; I am trying to make a safe input function, since it's tedious to keep writing a bunch of crap with ...

First off, I know that if nothing is left in the input buffer because the destination string and the input received are both the same size, then the scanf function is an error.

How would I go about checking the input buffer?

The other solution I have is to make a string in the function, of say BUFSIZ, which should be large enough to accommodate any string input, and then strncpy() the appropriate length to the destination string.

Another idea I was thinking of, was using ungetc() to force something onto the input buffer, so that the call to scanf to clear the input buffer would always have a purpose.

If someone could look this over and give any ideas/tips, I'd be thankful.