string-conversion.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --- libbinio-1.4/src/binfile.cpp.stringconversion 2008-06-10 19:00:43.349866044 +0200
  2. +++ libbinio-1.4/src/binfile.cpp 2008-06-10 19:00:47.585864964 +0200
  3. @@ -151,12 +151,12 @@ binofstream::~binofstream()
  4. void binofstream::open(const char *filename, const Mode mode)
  5. {
  6. - char *modestr = "wb";
  7. + std::string modestr = "wb";
  8. // Check if append mode is desired
  9. if(mode & Append) modestr = "ab";
  10. - f = fopen(filename, modestr);
  11. + f = fopen(filename, modestr.c_str());
  12. if(f == NULL)
  13. switch(errno) {
  14. @@ -209,7 +209,7 @@ binfstream::~binfstream()
  15. void binfstream::open(const char *filename, const Mode mode)
  16. {
  17. - char *modestr = "w+b"; // Create & at beginning
  18. + std::string modestr = "w+b"; // Create & at beginning
  19. int ferror = 0;
  20. // Apply desired mode
  21. @@ -220,7 +220,7 @@ void binfstream::open(const char *filena
  22. if(mode & Append) // Create & append
  23. modestr[0] = 'a';
  24. - f = fopen(filename, modestr);
  25. + f = fopen(filename, modestr.c_str());
  26. // NoCreate & append (emulated -- not possible with standard C fopen())
  27. if(f != NULL && (mode & Append) && (mode & NoCreate))