aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/os/env.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 360609c50d..ec266796a8 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -266,10 +266,8 @@ void os_copy_fullenv(char **env, size_t env_size)
extern char **environ;
# endif
- size_t i = 0;
- while (environ[i] != NULL && i < env_size) {
+ for (size_t i = 0; i < env_size && environ[i] != NULL; i++) {
env[i] = xstrdup(environ[i]);
- i++;
}
#endif
}