aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/fs.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-22 12:50:59 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-22 13:00:51 -0400
commite2e47803bdfd5fb40e3dbc9cdf798bb27d306c72 (patch)
tree6ff1b06b5d5fd6d3260f3a778c33cfaf03f0c295 /src/nvim/os/fs.c
parent0aa8b5828cc0674894681841f40c3c05bfd2f07b (diff)
parente303a11ebfc352860cce73184ece692ab4d0f01c (diff)
downloadrneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.gz
rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.bz2
rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.zip
Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'
- replace alloc with xmalloc
Diffstat (limited to 'src/nvim/os/fs.c')
-rw-r--r--src/nvim/os/fs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 47bf2fd933..861e1b46c5 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -89,8 +89,8 @@ static bool is_executable_in_path(const char_u *name)
return false;
}
- int buf_len = STRLEN(name) + STRLEN(path) + 2;
- char_u *buf = alloc((unsigned)(buf_len));
+ size_t buf_len = STRLEN(name) + STRLEN(path) + 2;
+ char_u *buf = xmalloc(buf_len);
// Walk through all entries in $PATH to check if "name" exists there and
// is an executable file.
@@ -103,7 +103,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);
- append_path((char *) buf, (const char *) name, buf_len);
+ append_path((char *) buf, (const char *) name, (int)buf_len);
if (is_executable(buf)) {
// Found our executable. Free buf and return.