[neovim] 01/02: window: Fix cmd_with_count's formatting when sizeof(long) != 8
James McCoy
jamessan at debian.org
Wed Oct 12 20:15:56 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 78a8a63ac52b6212f9fda17e19a0d9638342800c
Author: James McCoy <jamessan at jamessan.com>
Date: Sun Oct 9 23:03:13 2016 -0400
window: Fix cmd_with_count's formatting when sizeof(long) != 8
On architectures where `sizeof(long)` != 8, "%" PRId64 will read junk from
memory. This was seen on various Debian builds where
test/functional/legacy/close_count_spec.lua would fail due to `1<C-w>c`
emitting an error like `E488: Trailing characters: close-87944975647104`.
Changing the `Prenum` parameter to int64_t ensures it is safe to use
`"%" PRId64`, and make another small step towards removal of the use of
`long`.
---
src/nvim/window.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 350b54d..b1c3346 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -482,7 +482,7 @@ wingotofile:
}
static void cmd_with_count(char *cmd, char_u *bufp, size_t bufsize,
- long Prenum)
+ int64_t Prenum)
{
size_t len = xstrlcpy((char *)bufp, cmd, bufsize);
--
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