want good code style
fix 2 bugs, first: find_last_not_of error, second: compare("\r\n") loop forever