From 21784aeb005e78f04f4c1d398bc486be0a65248e Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Fri, 9 May 2014 03:30:26 -0300 Subject: Replace alloc() with xmalloc() and remove immediate OOM checks --- src/nvim/os/fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/os/fs.c') 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. -- cgit