mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Avoid warnings by using sprintf_s on MSVC.
Also use std::snprintf on other platforms.
This commit is contained in:
@@ -65,7 +65,11 @@ std::size_t TCPStream::send(const char* buffer, std::size_t len, Error* err) {
|
||||
}
|
||||
if (!result) {
|
||||
char Buffer[128];
|
||||
sprintf(Buffer, "Send() failed: WSA error=%d\n", WSAGetLastError());
|
||||
#ifdef _MSC_VER
|
||||
sprintf_s(Buffer, "Send() failed: WSA error=%d\n", WSAGetLastError());
|
||||
#else
|
||||
std::snprintf(Buffer, 128, "Send() failed: WSA error=%d\n", WSAGetLastError());
|
||||
#endif
|
||||
OutputDebugStringA(Buffer);
|
||||
*err = kConnectionReset;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user