K
Kelsey Bjarnason
[snips]
Err... wasn't one of the key features of your trim() that if fed an
invalid pointer, it would simply march along, trimming memory?
That could very well lead to reading memory you don't own, causing a
segfault - or worse - yet be perfectly consistent with the described
operation of the function - and thus, not a caller error at all.
Aside from the ptrdiff_t issue, how can it fail?
Segfaulting is a caller's error, not a defect in trim(). What other
failure scenario is there?
Err... wasn't one of the key features of your trim() that if fed an
invalid pointer, it would simply march along, trimming memory?
That could very well lead to reading memory you don't own, causing a
segfault - or worse - yet be perfectly consistent with the described
operation of the function - and thus, not a caller error at all.