News for hackers. Stuff that matters.
Re:The Most Expensive One-byte Mistake (2011) by TheSoftwareGuy on Friday April 11, 2014 @05:08PM (#7575653)
instead of a length field, use a pointer to the last character. the length is the difference of these two pointers. The maximum string length is the size of your address space. Problem solved.
Re:The Most Expensive One-byte Mistake (2011) by thedufer on Saturday April 12, 2014 @01:08AM (#7577043)
The problem is hardly solved. Your string length computation is already wrong - the length is the difference between those pointers plus one.