[vim/vim] xxd: use %lu for unsigned long in decimal offset output (PR #20055)

2 views
Skip to first unread message

mattn

unread,
4:30 AM (8 hours ago) 4:30 AM
to vim/vim, Subscribed

The decimal offset (-d) used %ld with an unsigned long value, so offsets above LONG_MAX were printed as negative numbers. Use %lu instead.

$ printf 'AB' | ./xxd -d -o 9223372036854775808
-9223372036854775808: 4142                                     AB

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20055

Commit Summary

  • 1e202b1 ues %lu for unsigned long

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20055@github.com>

Christian Brabandt

unread,
11:11 AM (1 hour ago) 11:11 AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20055)

can you add a test for this please?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20055/c4314205198@github.com>

mattn

unread,
12:19 PM (7 minutes ago) 12:19 PM
to vim/vim, Push

@mattn pushed 1 commit.


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20055/before/1e202b1f40e7ea9f1503256faa2667dabdcf6617/after/45c467f5064bc46a922b672dac125c212add4e11@github.com>

mattn

unread,
12:19 PM (7 minutes ago) 12:19 PM
to vim/vim, Subscribed
mattn left a comment (vim/vim#20055)

CI failure was caused by the test itself being wrong: Test_xxd_buffer_overflow() expected -9223372036854775808: in the address field, which was a side effect of the original %ld-on-unsigned long bug. The address field must be unsigned (consistent with the hex %lx default), so I've updated the expected value to 9223372036854775808:.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20055/c4314658855@github.com>

Reply all
Reply to author
Forward
0 new messages