Normally, I'd agree with you, but since the data is coming over a serial port, I wouldn't expect the line endings to be consistent with those used on whatever platform runs the code. So in this case, I'd prefer explicit removal of junk from the end.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re^3: Strings mangled on printing
by roboticus
in thread Strings mangled on printing
by gordu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |