From fe4920f138897138cc6eb76306677c4a5bc7980a Mon Sep 17 00:00:00 2001 From: oni-link Date: Sun, 8 Mar 2015 12:49:53 +0100 Subject: Remove unnecessary assert() in os_dirname(). Compiler warns about buf always being nonnull. buf is per function attribute always nonnull, so buf can be removed from the assert(). But a buffer length of zero is also no problem, because it makes uv_cwd() return a failure without writing into buf. So the remaining length check can also be removed. --- src/nvim/os/fs.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 242f8fb461..6200685076 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -42,8 +42,6 @@ int os_chdir(const char *path) int os_dirname(char_u *buf, size_t len) FUNC_ATTR_NONNULL_ALL { - assert(buf && len); - int error_number; if ((error_number = uv_cwd((char *)buf, &len)) != kLibuvSuccess) { STRLCPY(buf, uv_strerror(error_number), len); -- cgit From 681125eb94d91d25425f46f72557b8083e94c732 Mon Sep 17 00:00:00 2001 From: oni-link Date: Sun, 8 Mar 2015 13:11:12 +0100 Subject: Compiler warns about uninitialized object in vim_eval(). In case of an evaluation error the returned Object is not initialized, so initialize it with OBJECT_INIT. --- src/nvim/api/vim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index f852c8b561..587e19fe35 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -145,7 +145,7 @@ String vim_command_output(String str, Error *err) Object vim_eval(String str, Error *err) FUNC_ATTR_DEFERRED { - Object rv; + Object rv = OBJECT_INIT; // Evaluate the expression try_start(); typval_T *expr_result = eval_expr((char_u *) str.data, NULL); -- cgit