strerror
is deprecated because it’s not thread-safe. strerror
works on an internal static buffer, which may be overwritten by other, concurrent threads. You should use a secure variant called strerror_s
.
The secure variant requires that the buffer size be passed to the function in order to validate that the buffer is large enough before writing to it, helping to avoid buffer overruns that could allow malicious code to execute.