From 8093f218755cdbfc929e2e99c11e97e77e91c554 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Ho=C5=A1ek?= Date: Sun, 7 Oct 2007 09:13:08 +0000 Subject: [PATCH] Fix #137: explicitly convert argument from int to char to eliminate issues on big-endian systems (thanks Auria!) SVN-Revision: 5162 --- src/physfs/physfs_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/physfs/physfs_stream.cpp b/src/physfs/physfs_stream.cpp index e1d155772..c4347b244 100644 --- a/src/physfs/physfs_stream.cpp +++ b/src/physfs/physfs_stream.cpp @@ -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(); } -- 2.11.0