diff options
author | Simei Yin | 2018-05-30 19:22:46 +0200 |
---|---|---|
committer | Simei Yin | 2018-05-31 23:15:09 +0200 |
commit | 6004cd319d3c865821bc2be29647222c957ed517 (patch) | |
tree | 4d9697d1c70664e8745ff486c12238d1ca68f8c4 /engines/sludge/moreio.cpp | |
parent | 7edac197e4aa9846b71f398d9c5a4d56c5b7c34e (diff) | |
download | scummvm-rg350-6004cd319d3c865821bc2be29647222c957ed517.tar.gz scummvm-rg350-6004cd319d3c865821bc2be29647222c957ed517.tar.bz2 scummvm-rg350-6004cd319d3c865821bc2be29647222c957ed517.zip |
SLUDGE: Move createCString() with string tools
Diffstat (limited to 'engines/sludge/moreio.cpp')
-rw-r--r-- | engines/sludge/moreio.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/sludge/moreio.cpp b/engines/sludge/moreio.cpp index 1512574207..ee9ab8e0f0 100644 --- a/engines/sludge/moreio.cpp +++ b/engines/sludge/moreio.cpp @@ -167,4 +167,15 @@ Common::String decodeFilename(const Common::String &nameIn) { return newName; } +char *createCString(const Common::String &s) { + uint n = s.size() + 1; + char *res = new char[n]; + if (!checkNew(res)) { + fatal("createCString : Unable to copy String"); + return NULL; + } + memcpy(res, s.c_str(), n); + return res; +} + } // End of namespace Sludge |