Skip to content

fix: handle reads with len > 0#4

Open
pvainio wants to merge 1 commit intoxiegeo:masterfrom
pvainio:master
Open

fix: handle reads with len > 0#4
pvainio wants to merge 1 commit intoxiegeo:masterfrom
pvainio:master

Conversation

@pvainio
Copy link

@pvainio pvainio commented Mar 3, 2026

Read should not return negative values, but theare are some serial libraries that do return -1 in case of error against the specification.

In case of Read returns -1 currently p[read:read+n] panics. If we check read > 0 instead of read != 0 this would not be a problem.

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.

1 participant