AMIGAOS: Don't use unsafe strcat and strcpy
This commit is contained in:
parent
523ed4a34d
commit
5a0e4ced67
2 changed files with 5 additions and 4 deletions
|
@ -41,7 +41,7 @@ struct Library *AslBase;
|
|||
Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser) {
|
||||
|
||||
char pathBuffer[MAXPATHLEN];
|
||||
strcpy(pathBuffer, "SYS:");
|
||||
Common::strcpy_s(pathBuffer, "SYS:");
|
||||
|
||||
Common::String newTitle = title.encode(Common::kISO8859_1);
|
||||
|
||||
|
|
|
@ -314,9 +314,10 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
|
|||
IDOS->CopyStringBSTRToC(dosList->dol_Name, buffer, MAXPATHLEN);
|
||||
|
||||
// Volume name + '\0'
|
||||
char *volName = new char [strlen(buffer) + 1];
|
||||
strcpy(volName, buffer);
|
||||
strcat(buffer, ":");
|
||||
size_t volNameSize = strlen(buffer) + 1;
|
||||
char *volName = new char [volNameSize];
|
||||
Common::strcpy_s(volName, volNameSize, buffer);
|
||||
Common::strcat_s(buffer, ":");
|
||||
|
||||
BPTR volumeLock = IDOS->Lock((STRPTR)buffer, SHARED_LOCK);
|
||||
if (volumeLock) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue