mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
WINTERMUTE: Don't use unsafe strcat and strcpy
This commit is contained in:
committed by
Eugene Sandulenko
parent
4bbe3d9286
commit
73c09b1d56
@@ -75,19 +75,19 @@ SXArray::~SXArray() {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
const char *SXArray::scToString() {
|
||||
char dummy[32768];
|
||||
strcpy(dummy, "");
|
||||
dummy[0] = '\0';
|
||||
char propName[20];
|
||||
for (int i = 0; i < _length; i++) {
|
||||
sprintf(propName, "%d", i);
|
||||
ScValue *val = _values->getProp(propName);
|
||||
if (val) {
|
||||
if (strlen(dummy) + strlen(val->getString()) < 32768) {
|
||||
strcat(dummy, val->getString());
|
||||
Common::strcat_s(dummy, val->getString());
|
||||
}
|
||||
}
|
||||
|
||||
if (i < _length - 1 && strlen(dummy) + 1 < 32768) {
|
||||
strcat(dummy, ",");
|
||||
Common::strcat_s(dummy, ",");
|
||||
}
|
||||
}
|
||||
_strRep = dummy;
|
||||
|
||||
Reference in New Issue
Block a user