From 70186f2abb6da15a707342022700f9b8c8d3fc23 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sun, 31 Oct 2021 03:50:22 -0700 Subject: [PATCH] don't use size_t for a loop counter that is decremented --- src/env.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/env.cpp b/src/env.cpp index 3658b13ea..e4f284083 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -252,7 +252,7 @@ void env_init(const struct config_paths_t *paths, bool do_uvars, bool default_pa // (See issue #2784). wcstring key, val; const char *const *envp = environ; - size_t i = 0; + int i = 0; while (envp && envp[i]) i++; while (i--) { const wcstring key_and_val = str2wcstring(envp[i]); // like foo=bar @@ -1216,7 +1216,7 @@ mod_result_t env_stack_impl_t::set(const wcstring &key, env_mode_flags_t mode, result.uvar_modified = true; } else { // Unspecified scope with no existing variables. - auto node = resolve_unspecified_scope(); + node = resolve_unspecified_scope(); assert(node && "Should always resolve some scope"); set_in_node(node, key, std::move(val), flags); result.global_modified = (node == globals_);