A demonstration of the misuse of C's strncpy() function
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
strncpy_demo.c
strncpy_demo.log

README.md

This is a demonstration of the dangers of the standard C strncpy() function when used improperly. It's associated with my blog post at The Flat Trantor Society.

The strncpy_demo.log file contains the output that I get when I run the program on my system. In fact, the program's behavior is undefined; on other systems, or even the same one, it could easily print just hello, or print some longer string, or crash, or, in principle, re-format your hard drive.