Jim Meyering wrote: > > Could also be done, but since the code to remove newlines was there, I > > thought it is simpler to augment it to remove common garbage. > > I am reluctant to make this low-level decoding function ignore anything > else.
I agree. If you remove the garbage unconditionally, you have lost the functionality of doing strict checking of the input. If you add a 'bool' parameter that determines whether the remove it, you have added complexity in the interface (.h file) for nearly nothing. Keep separate tasks in separate code. Bruno