Add function to replace carriage-return to line-feed in buffer