summaryrefslogtreecommitdiffstats
path: root/src/memline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-10-03 18:25:00 +0200
committerBram Moolenaar <Bram@vim.org>2012-10-03 18:25:00 +0200
commite1704bada4554f4edc95ac6be50144dd7b95332b (patch)
treea9e9a1fd34a6ed5ba126b8dfc4ecd45dfedff394 /src/memline.c
parentb213da0b5742c6615837436ef4f75a416a534f06 (diff)
updated for version 7.3.677v7.3.677
Problem: buf_spname() is used inconsistently. Solution: Make the return type a char_u pointer. Check the size of the returned string.
Diffstat (limited to 'src/memline.c')
-rw-r--r--src/memline.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/memline.c b/src/memline.c
index 2a2426d672..fecd876373 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -780,9 +780,7 @@ ml_open_file(buf)
need_wait_return = TRUE; /* call wait_return later */
++no_wait_return;
(void)EMSG2(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
- buf_spname(buf) != NULL
- ? (char_u *)buf_spname(buf)
- : buf->b_fname);
+ buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
--no_wait_return;
}
@@ -1315,7 +1313,7 @@ ml_recover()
smsg((char_u *)_("Using swap file \"%s\""), NameBuff);
if (buf_spname(curbuf) != NULL)
- STRCPY(NameBuff, buf_spname(curbuf));
+ vim_strncpy(NameBuff, buf_spname(curbuf), MAXPATHL - 1);
else
home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Original file \"%s\""), NameBuff);