diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-06-13 18:09:08 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-13 18:09:08 -0400 |
commit | 8bbeb4b480a72d0099a18c4d8200313600045231 (patch) | |
tree | cf153eceb121aef15e50631282e9171a24b74406 /src/nvim/os | |
parent | 5b3b3fd3ed4372866730ae857e8c09d6e5d1167d (diff) | |
parent | d430f039d1255eaab55470b5613d83c24d030a64 (diff) | |
download | rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.tar.gz rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.tar.bz2 rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.zip |
Merge #743 'Replace vim_strncpy with strlcpy'
Diffstat (limited to 'src/nvim/os')
-rw-r--r-- | src/nvim/os/fs.c | 4 | ||||
-rw-r--r-- | src/nvim/os/users.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 48bc75cb8e..c8408d78e4 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -39,7 +39,7 @@ int os_dirname(char_u *buf, size_t len) int errno; if ((errno = uv_cwd((char *)buf, &len)) != kLibuvSuccess) { - vim_strncpy(buf, (char_u *)uv_strerror(errno), len - 1); + STRLCPY(buf, uv_strerror(errno), len); return FAIL; } return OK; @@ -123,7 +123,7 @@ static bool is_executable_in_path(const char_u *name) // Glue together the given directory from $PATH with name and save into // buf. - vim_strncpy(buf, (char_u *) path, e - path); + STRLCPY(buf, path, e - path + 1); append_path((char *) buf, (const char *) name, (int)buf_len); if (is_executable(buf)) { diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index 707a2f5ee9..e687ff3546 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -56,7 +56,7 @@ int os_get_uname(uid_t uid, char *s, size_t len) if ((pw = getpwuid(uid)) != NULL && pw->pw_name != NULL && *(pw->pw_name) != NUL) { - vim_strncpy((char_u *)s, (char_u *)pw->pw_name, len - 1); + STRLCPY(s, pw->pw_name, len); return OK; } #endif |