Use functions from the C++ standard library

This commit is contained in:
Chris Thrasher committed 2024-09-27 14:19:37 -06:00
1 parent c74378bade
commit 37e78942ed
4 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -41,7 +41,7 @@ namespace
if (address) if (address)
{ {
strncpy(result.address, address->toString().c_str(), 15); std::strncpy(result.address, address->toString().c_str(), 15);
} }
return result; return result;
@@ -97,7 +97,7 @@ sfIpAddress sfIpAddress_fromInteger(uint32_t address)
void sfIpAddress_toString(sfIpAddress address, char* string) void sfIpAddress_toString(sfIpAddress address, char* string)
{ {
if (string) if (string)
strcpy(string, address.address); std::strcpy(string, address.address);
} }
+1 -1
View File
@@ -82,7 +82,7 @@ sfIpAddress sfTcpSocket_getRemoteAddress(const sfTcpSocket* socket)
sfIpAddress result = sfIpAddress_None; sfIpAddress result = sfIpAddress_None;
if (address) if (address)
{ {
strncpy(result.address, address->toString().c_str(), 15); std::strncpy(result.address, address->toString().c_str(), 15);
} }
return result; return result;
+2 -2
View File
@@ -139,7 +139,7 @@ sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket,
if (address) if (address)
{ {
strncpy(remoteAddress->address, address->toString().c_str(), 15); std::strncpy(remoteAddress->address, address->toString().c_str(), 15);
} }
} }
@@ -187,7 +187,7 @@ sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet,
if (address) if (address)
{ {
strncpy(remoteAddress->address, address->toString().c_str(), 15); std::strncpy(remoteAddress->address, address->toString().c_str(), 15);
} }
} }
+1 -1
View File
@@ -33,5 +33,5 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFree(void* ptr) void sfFree(void* ptr)
{ {
free(ptr); std::free(ptr);
} }