Mercurial > vim
diff src/time.c @ 24768:7334bf933510 v8.2.2922
patch 8.2.2922: computing array length is done in various ways
Commit: https://github.com/vim/vim/commit/eeec2548785b2dd245a31ab25d7bde0f88ea1a6d
Author: K.Takata <kentkt@csc.jp>
Date: Wed Jun 2 13:28:16 2021 +0200
patch 8.2.2922: computing array length is done in various ways
Problem: Computing array length is done in various ways.
Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes https://github.com/vim/vim/issues/8305)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 02 Jun 2021 13:30:05 +0200 |
parents | 788d7e3ade7c |
children | 532faf893d37 |
line wrap: on
line diff
--- a/src/time.c +++ b/src/time.c @@ -276,8 +276,7 @@ f_strftime(typval_T *argvars, typval_T * wp = enc_to_utf16(p, NULL); if (wp != NULL) - (void)wcsftime(result_buf, sizeof(result_buf) / sizeof(WCHAR), - wp, curtime); + (void)wcsftime(result_buf, ARRAY_LENGTH(result_buf), wp, curtime); else result_buf[0] = NUL; rettv->vval.v_string = utf16_to_enc(result_buf, NULL);