diff options
author | Max Horn | 2002-10-23 12:12:19 +0000 |
---|---|---|
committer | Max Horn | 2002-10-23 12:12:19 +0000 |
commit | d0fba1e595dc59307eccdc6b0980615146aab50e (patch) | |
tree | 9c1e2bada7b1e2fb60bddaf474e888d649d8ccc5 /scumm/smush | |
parent | 5c54e3533bd246141b9fba4918e18f66d123ce43 (diff) | |
download | scummvm-rg350-d0fba1e595dc59307eccdc6b0980615146aab50e.tar.gz scummvm-rg350-d0fba1e595dc59307eccdc6b0980615146aab50e.tar.bz2 scummvm-rg350-d0fba1e595dc59307eccdc6b0980615146aab50e.zip |
don't use strdup
svn-id: r5285
Diffstat (limited to 'scumm/smush')
-rw-r--r-- | scumm/smush/chunk.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp index efc3d61953..3e392c72c5 100644 --- a/scumm/smush/chunk.cpp +++ b/scumm/smush/chunk.cpp @@ -24,6 +24,7 @@ #include "common/engine.h" // for debug, warning, error #include "common/file.h" +#include "common/str.h" #include <stdio.h> // for FILE, fopen, fclose, fseek and ftell #include <string.h> // for memcpy @@ -33,20 +34,18 @@ implements reference counting, so that ::file_Chunk does not leak memory ! */ class FilePtr { - char * _filename; + ScummVM::String _filename; File _ifs; int32 _refcount; int32 _curPos; public: - FilePtr(const char * fname, const char * directory) : _refcount(1), _curPos(0) { + FilePtr(const char * fname, const char * directory) : _filename(fname), _refcount(1), _curPos(0) { debug(9, "FilePtr created for %s", fname); - _filename = strdup(fname); _ifs.open(fname, directory); if(_ifs.isOpen() == false) error("FilePtr unable to read file %s", fname); } ~FilePtr() { - debug(9, "FilePtr destroyed for %s", _filename); - free(_filename); + debug(9, "FilePtr destroyed for %s", _filename.c_str()); _ifs.close(); } int32 tell() { |