@frostschutz: Pushed the linefeeds fixes

.
@sherman: They're
here. I *think* that's a somewhat sensible approach, but you're probably more familiar with this logic than I am. It's mostly all related to not calling u8_dec when the index is 0, as it would happily look *before* the buffer, and underflow the index.
Besides the test-cases provided by @frostschutz, the only other edge-case I could actually trigger is with a single character *right* above the size limit. I couldn't actually trigger a crash, but I did get an underflow, and by chance it happened to find a bogus break (very) soon after the wrapped-around value, so it mostly slipped through the cracks unnoticed.
Now it reliably aborts with the proper "you blew the LW" error.