aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-23 15:49:17 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-23 15:49:17 -0300
commitc6483aa2fae07654f8a874a0c479916de33ec592 (patch)
treef365546a61574300f6a79e74cf4c9417700fd77f /src/nvim/api/vim.c
parentee60683b9a5159e184c41f0dbd8121f082521019 (diff)
downloadrneovim-c6483aa2fae07654f8a874a0c479916de33ec592.tar.gz
rneovim-c6483aa2fae07654f8a874a0c479916de33ec592.tar.bz2
rneovim-c6483aa2fae07654f8a874a0c479916de33ec592.zip
API: Bugfix: Fix loop condition in vim_list_runtime_paths
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 505844e651..5796d7bc0e 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -94,14 +94,12 @@ StringArray vim_list_runtime_paths(void)
rtp++;
}
- // index
- uint32_t i = 0;
// Allocate memory for the copies
rv.items = xmalloc(sizeof(String) * rv.size);
// reset the position
rtp = p_rtp;
// Start copying
- while (*rtp != NUL) {
+ for (size_t i = 0; i < rv.size && *rtp != NUL; i++) {
rv.items[i].data = xmalloc(MAXPATHL);
// Copy the path from 'runtimepath' to rv.items[i]
int length = copy_option_part(&rtp,
@@ -110,7 +108,6 @@ StringArray vim_list_runtime_paths(void)
",");
assert(length >= 0);
rv.items[i].size = (size_t)length;
- i++;
}
return rv;