Assert against null string arguments

See https://github.com/SFML/SFML/pull/3211
This commit is contained in:
Chris Thrasher committed 2024-11-01 15:09:49 -06:00
1 parent 14378de263
commit e468aa651b
1 file changed
+8 -8
+8 -8
View File
@@ -173,14 +173,14 @@ double sfPacket_readDouble(sfPacket* packet)
void sfPacket_readString(sfPacket* packet, char* string)
{
assert(packet);
if (string)
*packet >> string;
assert(string);
*packet >> string;
}
void sfPacket_readWideString(sfPacket* packet, wchar_t* string)
{
assert(packet);
if (string)
*packet >> string;
assert(string);
*packet >> string;
}
@@ -232,12 +232,12 @@ void sfPacket_writeDouble(sfPacket* packet, double value)
void sfPacket_writeString(sfPacket* packet, const char* string)
{
assert(packet);
if (string)
*packet << string;
assert(string);
*packet << string;
}
void sfPacket_writeWideString(sfPacket* packet, const wchar_t* string)
{
assert(packet);
if (string)
*packet << string;
assert(string);
*packet << string;
}