This is C.
1. My question is how would I read in an integer securely from stdin.
I saw the following snippets:
http://www.daniweb.com/code/snippet441.html
http://www.daniweb.com/code/snippet597.html
Would those functions protect from integer overflows/underflows AND format string attacks?
2. What about strings?
Does a simple use of fgets protect from buffer overflows AND format string attacks?