Mercurial > vim
diff src/vim9compile.c @ 19392:5b6f420e7352 v8.2.0254
patch 8.2.0254: compiler warning for checking size_t to be negative
Commit: https://github.com/vim/vim/commit/ae8d2de3a9c0436a543c7d46071104af31ff6db7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 13 21:42:24 2020 +0100
patch 8.2.0254: compiler warning for checking size_t to be negative
Problem: Compiler warning for checking size_t to be negative.
Solution: Only check for zero. (Zoltan Arpadffy)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 13 Feb 2020 21:45:03 +0100 |
parents | 3a579cadceb6 |
children | bc880a130120 |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -138,7 +138,7 @@ lookup_local(char_u *name, size_t len, c { int idx; - if (len <= 0) + if (len == 0) return -1; for (idx = 0; idx < cctx->ctx_locals.ga_len; ++idx) { @@ -160,7 +160,7 @@ lookup_arg(char_u *name, size_t len, cct { int idx; - if (len <= 0) + if (len == 0) return -1; for (idx = 0; idx < cctx->ctx_ufunc->uf_args.ga_len; ++idx) {