diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-09 19:33:32 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-09 19:33:32 +0100 |
commit | 489b51db96ec8a8cbcef5306ddd680e120ae12d6 (patch) | |
tree | 26af876dcfd0b63d7f2fd6a325e43965d4882239 /plugins/adplug | |
parent | ed0e5fca963b28b9e71ac95e26f212d7af5a0007 (diff) |
constant memwrite bugfix to libbinio
Diffstat (limited to 'plugins/adplug')
-rw-r--r-- | plugins/adplug/libbinio/binfile.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/adplug/libbinio/binfile.cpp b/plugins/adplug/libbinio/binfile.cpp index 446f899f..336f1b3b 100644 --- a/plugins/adplug/libbinio/binfile.cpp +++ b/plugins/adplug/libbinio/binfile.cpp @@ -44,7 +44,7 @@ void binfbase::close() void binfbase::seek(long pos, Offset offs) { - int error; + int error = 0; if(f == NULL) { err |= NotOpen; return; } @@ -151,7 +151,7 @@ binofstream::~binofstream() void binofstream::open(const char *filename, const Mode mode) { - char *modestr = "wb"; + const char *modestr = "wb"; // Check if append mode is desired if(mode & Append) modestr = "ab"; @@ -209,16 +209,16 @@ binfstream::~binfstream() void binfstream::open(const char *filename, const Mode mode) { - char *modestr = "w+b"; // Create & at beginning + const char *modestr = "w+b"; // Create & at beginning int ferror = 0; // Apply desired mode if(mode & NoCreate) { if(!(mode & Append)) - modestr[0] = 'r'; // NoCreate & at beginning + modestr = "r+b"; // NoCreate & at beginning } else if(mode & Append) // Create & append - modestr[0] = 'a'; + modestr = "a+b"; f = fopen(filename, modestr); |