News for hackers. Stuff that matters.
Re:Designing a better strcpy by habibur on Sunday June 20, 2021 @03:06AM (#27567838)
Microsoft's MFC used to do this in their first version. But later ditched it. Maybe they found it not worth the trouble of checking for this condition everywhere. Increase in code.
Re:Designing a better strcpy by gpderetta on Sunday June 20, 2021 @05:19AM (#27568429)
Thse days, in C++, this is routinely done in various std::string implementations (which are both null terminated and have a separate length). In fact the standard was updated to explicitly allow this.