compnerd / swift-win32

A Windows application framework for Swift
https://compnerd.github.io/swift-win32/
BSD 3-Clause "New" or "Revised" License
1.11k stars 69 forks source link

Platform: avoid warning from use of `_strerror_s` #736

Closed compnerd closed 1 year ago

compnerd commented 1 year ago

The buffer size for _strerror and _wcserror are fixed at 94 characters. Use this to allocate the fixed size buffer and build the error message using _wcserror_s to avoid the warning as the allocation should be small enough to get stack promoted.