Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

head: fix subtraction underflow with --bytes=-N #7036

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

jfinkels
Copy link
Collaborator

Fix a subtraction underflow that occurred on head --bytes=-N when the input had fewer than N bytes. Before this commit,

printf "a" | head -c -2

would panic. After this commit, it terminates successfully with no output as expected.

Fix a subtraction underflow that occurred on `head --bytes=-N` when the
input had fewer than `N` bytes. Before this commit,

    printf "a" | head -c -2

would panic. After this commit, it terminates successfully with no
output as expected.
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit d81d893 into uutils:main Dec 31, 2024
63 checks passed
@jfinkels jfinkels deleted the head-too-many-negative-bytes branch January 2, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants