3 ms·
> Also note that SIZE_MAX is an unreasonable input, one would even say it violates preconditions. Annex K adds rsize_t, RSIZE_MAX, and friends, which restrict
by jmgao 11y ago
> Also note that SIZE_MAX is an unreasonable input, one would even say it violates preconditions.
Annex K adds rsize_t, RSIZE_MAX, and friends, which restrict inputs to reasonable values. Unfortunately, it doesn't retcon the old functions like strncpy, and worse, no one actually implements it.
- klodolph 11y agoNo one? I thought Microsoft implemented it, or at least an early version thereof.
- cremno 11y agoA very early version. Among other differences the functions don't care about RSIZE_MAX (even though newer VS versions define and use rsize_t). However the Windows SDK contains <strsafe.h> which does limit the length of strings (STRSAFE_MAX_CCH). https://msdn.microsoft.com/en-us/library/windows/desktop/ms647466%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...