From 1801d44f53e4340f5483902e6f0a2aa0ab4f551a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 29 Jan 2017 20:20:41 +0300 Subject: [PATCH] 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. --- src/nvim/viml/executor/executor.c | 6 +++--- 1 file 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