[neovim] 04/05: nvim_win_get_number: Use int as rv to fix BE issues

James McCoy jamessan at debian.org
Thu Nov 3 00:37:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository neovim.

commit cee07ad309ff8f32d9a22927f2a73a65732fefdb
Author: James McCoy <jamessan at jamessan.com>
Date:   Mon Oct 31 00:02:16 2016 -0400

    nvim_win_get_number: Use int as rv to fix BE issues
    
    rv is int64_t but its address is being passed into win_get_tabwin as if
    it were an int.  This breaks on big-endian systems, since win_get_tabwin
    will store the data to the "wrong" half of the int64_t, thus returning
    invalid data out of nvim_win_get_number.
---
 src/nvim/api/window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index ef881fa..1f555a6 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -348,7 +348,7 @@ Tabpage nvim_win_get_tabpage(Window window, Error *err)
 /// @return Window number
 Integer nvim_win_get_number(Window window, Error *err)
 {
-  Integer rv = 0;
+  int rv = 0;
   win_T *win = find_window_by_handle(window, err);
 
   if (!win) {
@@ -356,7 +356,7 @@ Integer nvim_win_get_number(Window window, Error *err)
   }
 
   int tabnr;
-  win_get_tabwin(window, &tabnr, (int *)&rv);
+  win_get_tabwin(window, &tabnr, &rv);
 
   return rv;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/neovim.git



More information about the pkg-vim-maintainers mailing list