Fix #137: explicitly convert argument from int to char to eliminate issues on big...
authorOndřej Hošek <ondra.hosek@gmail.com>
Sun, 7 Oct 2007 09:13:08 +0000 (09:13 +0000)
committerOndřej Hošek <ondra.hosek@gmail.com>
Sun, 7 Oct 2007 09:13:08 +0000 (09:13 +0000)
SVN-Revision: 5162

src/physfs/physfs_stream.cpp

index e1d1557..c4347b2 100644 (file)
@@ -128,6 +128,8 @@ OFileStreambuf::~OFileStreambuf()
 int
 OFileStreambuf::overflow(int c)
 {
+    char c2 = (char)c;
+
     if(pbase() == pptr())
         return 0;
 
@@ -137,7 +139,7 @@ OFileStreambuf::overflow(int c)
         return traits_type::eof();
 
     if(c != traits_type::eof()) {
-        PHYSFS_sint64 res = PHYSFS_write(file, &c, 1, 1);
+        PHYSFS_sint64 res = PHYSFS_write(file, &c2, 1, 1);
         if(res <= 0)
             return traits_type::eof();
     }