updated for version 7.2-200
diff --git a/src/os_unix.c b/src/os_unix.c
index 72b17c4..591b49c 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4305,7 +4305,8 @@
 				ta_buf[i] = '\n';
 # ifdef FEAT_MBYTE
 			    if (has_mbyte)
-				i += (*mb_ptr2len)(ta_buf + i) - 1;
+				i += (*mb_ptr2len_len)(ta_buf + i,
+							ta_len + len - i) - 1;
 # endif
 			}