forked from mirror/openmw-tes3mp
[Server] Make GetCellStateDescription's cstrDescription null-terminated
This commit is contained in:
parent
1c810ecad5
commit
9c3a37a790
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ const char *CellFunctions::GetCellStateDescription(unsigned short pid, unsigned
|
||||||
string cellDescription = player->cellStateChanges.cells.at(i).getDescription();
|
string cellDescription = player->cellStateChanges.cells.at(i).getDescription();
|
||||||
|
|
||||||
static vector<char> cstrDescription;
|
static vector<char> cstrDescription;
|
||||||
cstrDescription.reserve(cellDescription.size());
|
cstrDescription.reserve(cellDescription.size() + 1);
|
||||||
strncpy(&cstrDescription[0], cellDescription.c_str(), cstrDescription.capacity());
|
strncpy(&cstrDescription[0], cellDescription.c_str(), cstrDescription.capacity());
|
||||||
|
|
||||||
return &cstrDescription[0];
|
return &cstrDescription[0];
|
||||||
|
|
Loading…
Reference in a new issue