123456789101112131415161718192021222324252627282930313233343536 |
- --- libbinio-1.4/src/binfile.cpp.stringconversion 2008-06-10 19:00:43.349866044 +0200
- +++ libbinio-1.4/src/binfile.cpp 2008-06-10 19:00:47.585864964 +0200
- @@ -151,12 +151,12 @@ binofstream::~binofstream()
-
- void binofstream::open(const char *filename, const Mode mode)
- {
- - char *modestr = "wb";
- + std::string modestr = "wb";
-
- // Check if append mode is desired
- if(mode & Append) modestr = "ab";
-
- - f = fopen(filename, modestr);
- + f = fopen(filename, modestr.c_str());
-
- if(f == NULL)
- switch(errno) {
- @@ -209,7 +209,7 @@ binfstream::~binfstream()
-
- void binfstream::open(const char *filename, const Mode mode)
- {
- - char *modestr = "w+b"; // Create & at beginning
- + std::string modestr = "w+b"; // Create & at beginning
- int ferror = 0;
-
- // Apply desired mode
- @@ -220,7 +220,7 @@ void binfstream::open(const char *filena
- if(mode & Append) // Create & append
- modestr[0] = 'a';
-
- - f = fopen(filename, modestr);
- + f = fopen(filename, modestr.c_str());
-
- // NoCreate & append (emulated -- not possible with standard C fopen())
- if(f != NULL && (mode & Append) && (mode & NoCreate))
|