diff options
author | ZyX <kp-pav@yandex.ru> | 2017-01-29 20:20:41 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-27 00:12:42 +0300 |
commit | 1801d44f53e4340f5483902e6f0a2aa0ab4f551a (patch) | |
tree | e97407ddc8dae3ce81b57ed225aa21d0f18408e3 /src/nvim/viml/executor/executor.c | |
parent | 09fe6185b7b2c1f1379ff4add9f3f4da79a7b043 (diff) | |
download | rneovim-1801d44f53e4340f5483902e6f0a2aa0ab4f551a.tar.gz rneovim-1801d44f53e4340f5483902e6f0a2aa0ab4f551a.tar.bz2 rneovim-1801d44f53e4340f5483902e6f0a2aa0ab4f551a.zip |
executor: Do not use S_LEN for memcpy
Sometimes it is implemented as a macro and `S_LEN` is treated as a single
argument in this case.
Diffstat (limited to 'src/nvim/viml/executor/executor.c')
-rw-r--r-- | src/nvim/viml/executor/executor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/viml/executor/executor.c b/src/nvim/viml/executor/executor.c index a01bf9966d..ad92b52f3e 100644 --- a/src/nvim/viml/executor/executor.c +++ b/src/nvim/viml/executor/executor.c @@ -174,9 +174,9 @@ static int nlua_exec_luado_string(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL } else { lcmd = xmalloc(lcmd_len + 1); } - memcpy(lcmd, S_LEN(DOSTART)); + memcpy(lcmd, DOSTART, sizeof(DOSTART) - 1); memcpy(lcmd + sizeof(DOSTART) - 1, str->data, str->size); - memcpy(lcmd + sizeof(DOSTART) - 1 + str->size, S_LEN(DOEND)); + memcpy(lcmd + sizeof(DOSTART) - 1 + str->size, DOEND, sizeof(DOEND) - 1); #undef DOSTART #undef DOEND @@ -325,7 +325,7 @@ static int nlua_eval_lua_string(lua_State *const lstate) } else { lcmd = xmalloc(lcmd_len); } - memcpy(lcmd, S_LEN(EVALHEADER)); + memcpy(lcmd, EVALHEADER, sizeof(EVALHEADER) - 1); memcpy(lcmd + sizeof(EVALHEADER) - 1, str->data, str->size); lcmd[lcmd_len - 1] = ')'; #undef EVALHEADER |