aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
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;