diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-28 01:07:34 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:08:46 +0300 |
commit | 114eaa15f009cbd3e3deb177a2a67affa430fbb8 (patch) | |
tree | bf86e56b8e8dd3a86c08fe86b284a18475ba5598 /src/nvim/api/buffer.c | |
parent | 58e34e8d99b01bf3937824fc50502e39a8c39eba (diff) | |
download | rneovim-114eaa15f009cbd3e3deb177a2a67affa430fbb8.tar.gz rneovim-114eaa15f009cbd3e3deb177a2a67affa430fbb8.tar.bz2 rneovim-114eaa15f009cbd3e3deb177a2a67affa430fbb8.zip |
eval/typval,api/buffer: Fix review comments
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r-- | src/nvim/api/buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 037a6ee1da..26f9a6f592 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -296,7 +296,7 @@ void nvim_buf_set_lines(uint64_t channel_id, tabpage_T *save_curtab = NULL; size_t new_len = replacement.size; size_t old_len = (size_t)(end - start); - ssize_t extra = 0; // lines added to text, can be negative + ptrdiff_t extra = 0; // lines added to text, can be negative char **lines = (new_len != 0) ? xcalloc(new_len, sizeof(char *)) : NULL; for (size_t i = 0; i < new_len; i++) { @@ -342,8 +342,8 @@ void nvim_buf_set_lines(uint64_t channel_id, } } - if ((ssize_t)to_delete > 0) { - extra -= (ssize_t)to_delete; + if (to_delete > 0) { + extra -= (ptrdiff_t)to_delete; } // For as long as possible, replace the existing old_len with the |