mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Avoid warnings by using sprintf_s on MSVC.
Also use std::snprintf on other platforms.
This commit is contained in:
@@ -35,7 +35,11 @@ void NetworkTable::SetServerMode() { s_client = false; }
|
||||
|
||||
void NetworkTable::SetTeam(int team) {
|
||||
char tmp[30];
|
||||
sprintf(tmp, "%d.%d.%d.%d\n", 10, team / 100, team % 100, 2);
|
||||
#ifdef _MSC_VER
|
||||
sprintf_s(tmp, "%d.%d.%d.%d\n", 10, team / 100, team % 100, 2);
|
||||
#else
|
||||
std::snprintf(tmp, 30, "%d.%d.%d.%d\n", 10, team / 100, team % 100, 2);
|
||||
#endif
|
||||
SetIPAddress(tmp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user