mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)
When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
This commit is contained in:
@@ -1654,7 +1654,7 @@ char *eval_map_expr(mapblock_T *mp, int c)
|
||||
Array args = ARRAY_DICT_INIT;
|
||||
Object ret = nlua_call_ref(mp->m_luaref, NULL, args, true, &err);
|
||||
if (ret.type == kObjectTypeString) {
|
||||
p = xstrndup(ret.data.string.data, ret.data.string.size);
|
||||
p = string_to_cstr(ret.data.string);
|
||||
}
|
||||
api_free_object(ret);
|
||||
if (err.type != kErrorTypeNone) {
|
||||
|
Reference in New Issue
Block a user