From 4db7a4e0dbbd3dfa26177e85ee04a0ccb1a0029a Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Sun, 11 Jan 2015 00:16:18 +0300 Subject: [PATCH] Fix close return code --- SDL2pp/StreamRWops.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDL2pp/StreamRWops.hh b/SDL2pp/StreamRWops.hh index d6f17d4..4537dc8 100644 --- a/SDL2pp/StreamRWops.hh +++ b/SDL2pp/StreamRWops.hh @@ -107,7 +107,7 @@ private: template typename std::enable_if::value, int>::type CloseHelper() { stream_.flush(); - return stream_.rdstate() & std::ios_base::badbit; + return (stream_.rdstate() & std::ios_base::badbit) ? -1 : 0; } template