Switched to a fgets/line reader implementation.