mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 12:55:24 +00:00
TINSEL: Don't use unsafe strcat and strcpy
This commit is contained in:
parent
422d8d98ae
commit
52caebf8af
@ -193,7 +193,7 @@ bool TinselFile::open(const Common::String &filename) {
|
||||
// Form a filename without the CD number character
|
||||
char newFilename[50];
|
||||
strncpy(newFilename, fname, p - fname);
|
||||
strcpy(newFilename + (p - fname), p + 1);
|
||||
Common::strcpy_s(newFilename + (p - fname), sizeof(newFilename) - (p - fname), p + 1);
|
||||
|
||||
return openInternal(newFilename);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ int LoadStringResource(int id, int sub, char *pBuffer, int bufferMax) {
|
||||
byte *pText = FindStringBase(id);
|
||||
|
||||
if (pText == NULL) {
|
||||
strcpy(pBuffer, "!! HIGH STRING !!");
|
||||
Common::strcpy_s(pBuffer, bufferMax, "!! HIGH STRING !!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ int LoadStringResource(int id, int sub, char *pBuffer, int bufferMax) {
|
||||
}
|
||||
|
||||
// TEMPORARY DIRTY BODGE
|
||||
strcpy(pBuffer, "!! NULL STRING !!");
|
||||
Common::strcpy_s(pBuffer, bufferMax, "!! NULL STRING !!");
|
||||
|
||||
// string does not exist
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user