mmastrac / rust-libc-print

#[no_std] print equivalent for Rust
Apache License 2.0
60 stars 10 forks source link

Ensure that all bytes are written to the fd #64

Closed SabrinaJewson closed 2 years ago

SabrinaJewson commented 2 years ago

The current implementation has a bug that if the buffer is only partially written, it won't attempt to retry the option with the remaining bytes of the buffer. This PR fixes that by calling write in a loop. Also, I implemented some slightly more correct behaviour around integer limits by making use of try_from.

mmastrac commented 2 years ago

Thank you, this is great. Will push a new release.