Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

strncpy vs. strcpy

Name: Anonymous 2008-08-23 18:46

Both functions are perfectly fine to use as long as they're used correctly, with valid input, in a legible manner.

However, which one would you guys say is easier to misuse? Which one has a greater potential impact when misused in the most typical way? And which one do you see misused more often in real code?

Name: Anonymous 2008-08-23 22:30

I program C in my day job and I basically never use strncpy or strcpy. I basically never use any of the string functions, and instead just use functions that are more general: memcpy, memcmp, etc, and pad the strings myself.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List