mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
fix(api): convert blob to NUL-terminated API string
Looks like I did an oopsie; although API strings carry a size field, they should still be usable as C-strings! (even though they may contain embedded NULs)
This commit is contained in:
@@ -57,7 +57,7 @@ typedef struct {
|
||||
const size_t len_ = (size_t)(len); \
|
||||
const blob_T *const blob_ = (blob); \
|
||||
kvi_push(edata->stack, STRING_OBJ(((String) { \
|
||||
.data = len_ != 0 ? xmemdup(blob_->bv_ga.ga_data, len_) : NULL, \
|
||||
.data = len_ != 0 ? xmemdupz(blob_->bv_ga.ga_data, len_) : xstrdup(""), \
|
||||
.size = len_ \
|
||||
}))); \
|
||||
} while (0)
|
||||
|
Reference in New Issue
Block a user