aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorCameron Cawley2018-08-18 22:42:21 +0100
committerDavid Turner2018-08-19 11:47:28 +0100
commit0e8f1261c526f898fe698fd869baa514a42ec3a8 (patch)
treefaef2ea8536050e955ec5998a43f9fce885405af /backends
parent47c0e2701796962edd946ae463ae92ba806c4280 (diff)
downloadscummvm-rg350-0e8f1261c526f898fe698fd869baa514a42ec3a8.tar.gz
scummvm-rg350-0e8f1261c526f898fe698fd869baa514a42ec3a8.tar.bz2
scummvm-rg350-0e8f1261c526f898fe698fd869baa514a42ec3a8.zip
PS2: Replace usage of strdup with scumm_strdup
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/ps2/savefilemgr.cpp15
-rw-r--r--backends/platform/ps2/systemps2.cpp3
2 files changed, 10 insertions, 8 deletions
diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp
index 4cd988074e..bed996ef80 100644
--- a/backends/platform/ps2/savefilemgr.cpp
+++ b/backends/platform/ps2/savefilemgr.cpp
@@ -23,6 +23,7 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
#include "common/config-manager.h"
+#include "common/str.h"
#include "common/zlib.h"
// #include "backends/saves/compressed/compressed-saves.h"
@@ -115,8 +116,8 @@ Common::InSaveFile *Ps2SaveFileManager::openRawFile(const Common::String &filena
strcpy(temp, filename.c_str());
// mcSplit(temp, game, ext);
- char *game = strdup(strtok(temp, "."));
- char *ext = strdup(strtok(NULL, "*"));
+ char *game = scumm_strdup(strtok(temp, "."));
+ char *ext = scumm_strdup(strtok(NULL, "*"));
sprintf(path, "mc0:ScummVM/%s", game); // per game path
// mcCheck(path); // needed on load ?
@@ -183,8 +184,8 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil
strcpy(temp, filename.c_str());
// mcSplit(temp, game, ext);
- char *game = strdup(strtok(temp, "."));
- char *ext = strdup(strtok(NULL, "*"));
+ char *game = scumm_strdup(strtok(temp, "."));
+ char *ext = scumm_strdup(strtok(NULL, "*"));
sprintf(path, "mc0:ScummVM/%s", game); // per game path
mcCheck(path);
sprintf(path, "mc0:ScummVM/%s/%s.sav", game, ext);
@@ -217,8 +218,8 @@ bool Ps2SaveFileManager::removeSavefile(const Common::String &filename) {
strcpy(temp, filename.c_str());
// mcSplit(temp, game, ext);
- char *game = strdup(strtok(temp, "."));
- char *ext = strdup(strtok(NULL, "*"));
+ char *game = scumm_strdup(strtok(temp, "."));
+ char *ext = scumm_strdup(strtok(NULL, "*"));
sprintf(path, "mc0:ScummVM/%s", game); // per game path
mcCheck(path);
sprintf(path, "mc0:ScummVM/%s/%s.sav", game, ext);
@@ -254,7 +255,7 @@ Common::StringArray Ps2SaveFileManager::listSavefiles(const Common::String &patt
strcpy(temp, pattern.c_str());
// mcSplit(temp, game, ext);
- game = strdup(strtok(temp, "."));
+ game = scumm_strdup(strtok(temp, "."));
sprintf(path, "mc0:ScummVM/%s", game); // per game path
mcCheck(path);
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index f76e26a543..a20ac6ada9 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -46,6 +46,7 @@
#include "common/events.h"
#include "common/file.h"
#include "common/scummsys.h"
+#include "common/str.h"
#include "backends/platform/ps2/asyncfio.h"
#include "backends/platform/ps2/cd.h"
@@ -1096,7 +1097,7 @@ void OSystem_PS2::makeConfigPath() {
else
ps2_fclose(src);
- _configFile = strdup(path);
+ _configFile = scumm_strdup(path);
}
Common::String OSystem_PS2::getDefaultConfigFileName() {