mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-03 04:52:35 +02:00
TPT: strncpy for loading sign text in OPS 433c1881bc
This commit is contained in:
@@ -308,8 +308,12 @@ void GameSave::readOPS(char * data, int dataLength)
|
|||||||
{
|
{
|
||||||
if(strcmp(bson_iterator_key(&signiter), "text")==0 && bson_iterator_type(&signiter)==BSON_STRING)
|
if(strcmp(bson_iterator_key(&signiter), "text")==0 && bson_iterator_type(&signiter)==BSON_STRING)
|
||||||
{
|
{
|
||||||
tempSign.text = bson_iterator_string(&signiter);
|
char tempString[256];
|
||||||
|
strncpy(tempString, bson_iterator_string(&signiter), 255);
|
||||||
|
tempString[255] = 0;
|
||||||
clean_text((char*)tempSign.text.c_str(), 158-14);
|
clean_text((char*)tempSign.text.c_str(), 158-14);
|
||||||
|
|
||||||
|
tempSign.text = tempString;
|
||||||
}
|
}
|
||||||
else if(strcmp(bson_iterator_key(&signiter), "justification")==0 && bson_iterator_type(&signiter)==BSON_INT)
|
else if(strcmp(bson_iterator_key(&signiter), "justification")==0 && bson_iterator_type(&signiter)==BSON_INT)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user