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

Filter NULL bytes in expectLine #682

Merged
merged 1 commit into from
Nov 22, 2024
Merged

Conversation

martijnbastiaan
Copy link
Contributor

@martijnbastiaan martijnbastiaan commented Nov 22, 2024

Picocom sometimes produces NULL bytes. Attempts to debug this behavior have been futile, so this patch simply filters them out. This does remove the ability to send over binary data, but I don't think we want to do that over UART anyway..

Note: this removes a call to trim, in favor of trimEnd. We don't want to strip start of line whitespace..

Picocom sometimes produces NULL bytes. Attempts to debug this behavior
have been futile, so this patch simply filters them out. This does
remove the ability to send over binary data, but I don't think we want
to do that over UART anyway..
Copy link
Contributor

@leonschoorl leonschoorl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter (/= '\NUL') doesn't break the ability to ability to send over arbitrary raw bytes anymore then trim and hGetLine already did.

@martijnbastiaan martijnbastiaan merged commit f326684 into staging Nov 22, 2024
29 checks passed
@martijnbastiaan martijnbastiaan deleted the filter-null-bytes branch November 22, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants