Mercurial > vim
diff src/memline.c @ 419:f713fc55bf7b v7.0109
updated for version 7.0109
author | vimboss |
---|---|
date | Mon, 18 Jul 2005 21:58:11 +0000 |
parents | 575dacb554d8 |
children | 7f2d3b3c15a2 |
line wrap: on
line diff
--- a/src/memline.c +++ b/src/memline.c @@ -698,8 +698,7 @@ set_b0_fname(b0p, buf) /* Systems that cannot translate "~user" back into a path: copy the * file name unmodified. Do use slashes instead of backslashes for * portability. */ - STRNCPY(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE); - b0p->b0_fname[B0_FNAME_SIZE - 1] = NUL; + vim_strncpy(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE - 1); # ifdef BACKSLASH_IN_FILENAME forward_slash(b0p->b0_fname); # endif @@ -721,10 +720,7 @@ set_b0_fname(b0p, buf) /* If there is no user name or it is too long, don't use "~/" */ if (get_user_name(uname, B0_UNAME_SIZE) == FAIL || (ulen = STRLEN(uname)) + flen > B0_FNAME_SIZE - 1) - { - STRNCPY(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE); - b0p->b0_fname[B0_FNAME_SIZE - 1] = NUL; - } + vim_strncpy(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE - 1); else { mch_memmove(b0p->b0_fname + ulen + 1, b0p->b0_fname + 1, flen);