From e1704bada4554f4edc95ac6be50144dd7b95332b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 3 Oct 2012 18:25:00 +0200 Subject: updated for version 7.3.677 Problem: buf_spname() is used inconsistently. Solution: Make the return type a char_u pointer. Check the size of the returned string. --- src/memline.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/memline.c') 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); -- cgit v1.2.3