On Feb 21, 2014, at 22:26 , Sean Conner wrote:
...
3) Switch to using fgetc() in a loop. This too, degrades performance if
only because fgets() can use implementation details it is privy to to
increase performance, but it is still using standard C calls. Francisco
Olarte proposed this fix. And if a fix is to be used, this is the one I
would actually prefer (it's cleaner than #2, the performance degredation is
constant (not based on buffer size), portable, and provides consistent
behavior across C implementations).
...
Of the four that I see, #1 or #3 are the best solutions in my mind. All
(except #1) degrade performance somewhat, but I would prefer a correct
solution [2] over a fast solution.
-spc (Surprisingly, I'm not against #3 … )
test case.
loop would still be a favorable fix for me, too.