The C standard library is notoriously poor when it comes to I/O safety. Many functions have buffer overflows (gets, scanf), or can clobber memory if n
gets
scanf
For Windows there is a 'safe' C/C++ library.