Skip to content

Conversation

@sbilharz
Copy link

@sbilharz sbilharz commented Feb 21, 2020

strlen stops at the first NUL byte which breaks getting a proper grid
when the message contains any of them. The message length is known at
this point and can be passed to iec16022init instead of the message
pointer.

Edit: I now also removed the workaround that appended a blank to every input string. The strcat method also can't handle NUL bytes and I couldn't find a use case where this sort of fiddling was necessary in the first place.

strlen stops at the first NUL byte which breaks getting a proper grid
when the message contains any of them. The message length is known at
this point and can be passed to iec16022init instead of the message
pointer.
It seems odd to believe the underlying library has a bug requires us to
always append a blank at the end of the input. There might be some edge
cases where this is necessary but I did not encounter any so far.
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