patch 9.2.0394: xxd: offsets greater than LONG_MAX print as negative Commit: https://github.com/vim/vim/commit/8f9cde4592f1067c0104e1255314880d40441aa2 Author: Yasuhiro Matsumoto <[email protected]> Date: Sun Apr 26 08:22:23 2026 +0000 patch 9.2.0394: xxd: offsets greater than LONG_MAX print as negative Problem: xxd: offsets greater than LONG_MAX print as negative Solution: Use "%lu" to print unsigned long value (Yasuhiro Matsumoto) closes: #20055 Signed-off-by: Yasuhiro Matsumoto <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/src/testdir/test_xxd.vim b/src/testdir/test_xxd.vim index 472dfd4ee..430a07ccf 100644 --- a/src/testdir/test_xxd.vim +++ b/src/testdir/test_xxd.vim @@ -476,7 +476,7 @@ func Test_xxd_buffer_overflow() endif new let input = repeat('A', 256) - call writefile(['-9223372036854775808: ' . repeat(" [1;32m41 [0m ", 256) . ' ' . " [1;32m" . repeat('A', 256) . " [0m"], 'Xxdexpected', 'D') + call writefile(['9223372036854775808: ' . repeat(" [1;32m41 [0m ", 256) . ' ' . " [1;32m" . repeat('A', 256) . " [0m"], 'Xxdexpected', 'D') exe 'r! printf ' . input . '| ' . s:xxd_cmd . ' -Ralways -g1 -c256 -d -o 9223372036854775808 > Xxdout' call assert_equalfile('Xxdexpected', 'Xxdout') call delete('Xxdout') diff --git a/src/version.c b/src/version.c index d4b5c5100..0946dbadc 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 394, /**/ 393, /**/ diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index 535f0add3..fb45f6c28 100644 --- a/src/xxd/xxd.c +++ b/src/xxd/xxd.c @@ -74,6 +74,7 @@ * 26.11.2025 update indent in exit_with_usage() * 19.03.2026 Add -t option to end output with terminating null * 25.03.2026 Fix color output issues + * 26.04.2026 Use unsigned long for printing offsets * (c) 1990-1998 by Juergen Weigert ([email protected]) @@ -154,7 +155,7 @@ extern void perror __P((char *)); # endif #endif -char version[] = "xxd 2026-03-25 by Juergen Weigert et al."; +char version[] = "xxd 2026-04-26 by Juergen Weigert et al."; #ifdef WIN32 char osver[] = " (Win32)"; #else @@ -1172,7 +1173,7 @@ main(int argc, char *argv[]) { if (p == 0) addrlen = sprintf(l, decimal_offset ? "%08ld:" : "%08lx:", addrlen = sprintf(l, decimal_offset ? "%08lu:" : "%08lx:", ((unsigned long)(n + seekoff + displayoff))); for (c = addrlen; c < LLEN_NO_COLOR; l[c++] = ' ') ;
-- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wGusR-001vvP-Bj%40256bit.org.
