ZigEmbeddedGroup / serial

Serial port configuration library for Zig
MIT License
46 stars 18 forks source link

Reading UTF-16 into a UTF-8 buffer #12

Closed Plecra closed 5 months ago

Plecra commented 6 months ago

https://github.com/ZigEmbeddedGroup/serial/blob/394bf7c05693787c131cce2699e0040405f1ab6d/src/serial.zig#L237

This call to a widestring API is incorrect, and produces invalid strings in port_name and system_location. It's possible the bug affects other calls to winapi, I haven't checked.

Plecra commented 6 months ago

WindowsPortIterator looks fine at first glance :) https://github.com/ZigEmbeddedGroup/serial/blob/394bf7c05693787c131cce2699e0040405f1ab6d/src/serial.zig#L93