replaced own implementation with getline in libc