From: Ondřej Hošek Date: Sun, 7 Oct 2007 09:13:08 +0000 (+0000) Subject: Fix #137: explicitly convert argument from int to char to eliminate issues on big... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8093f218755cdbfc929e2e99c11e97e77e91c554;p=supertux.git Fix #137: explicitly convert argument from int to char to eliminate issues on big-endian systems (thanks Auria!) SVN-Revision: 5162 --- 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(); }