Fix buffer handling for gets call to appendline.