How big is FILE? Why are you reading it completely into RAM before using it?Fix: Iterate over FILE in a while-loop.
And that only works if the file has reasonably long lines. You are still in trouble if they give you '/dev/zero' as the filename. Even if the files can not be picked from a list, at least the program should ensure that they are located in a "reasonable" directory.
In reply to Re^2: Bad code from the trenches
by itub
in thread Bad code from the trenches
by Whitehawke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |