rdline: fix buffer when user validates with the cursor at the middle