News for hackers. Stuff that matters.
Re:Stop using strncpy already by jstanley on Thursday April 04, 2013 @05:15AM (#5491689)
Am I missing something obvious? I don't profess to know C++, but surely the proposed solution only works when writing to an array? There is no way for the compiler to know how much space has been allocated for arbitrary pointers.
Re:Stop using strncpy already by nitrogen on Thursday April 04, 2013 @07:11AM (#5491951)
Some malloc implementations do provide functions for determining the size of an allocated block, but that is also very problematic and certainly doesn't work with sizeof.