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 23:30

strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l

Copy characters of one string to another. These are versions of strncpy, _strncpy_l, wcsncpy, _wcsncpy_l, _mbsncpy, _mbsncpy_l with security enhancements as described in Security Enhancements in the CRT.

errno_t strncpy_s(
   char *strDest,
   size_t numberOfElements,
   const char *strSource,
   size_t count
);


lol microsoft

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