From e235c55e4a2c5d88d13c932206db90991fa093e0 Mon Sep 17 00:00:00 2001 From: derek Date: Fri, 27 Jul 2012 10:44:51 -0400 Subject: [PATCH] Fixed: improper mode check in local I/O device --- src/api/internal/io/ILocalIODevice_p.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/internal/io/ILocalIODevice_p.cpp b/src/api/internal/io/ILocalIODevice_p.cpp index 19cc1da..d515728 100644 --- a/src/api/internal/io/ILocalIODevice_p.cpp +++ b/src/api/internal/io/ILocalIODevice_p.cpp @@ -2,7 +2,7 @@ // ILocalIODevice_p.cpp (c) 2011 Derek Barnett // Marth Lab, Department of Biology, Boston College // --------------------------------------------------------------------------- -// Last modified: 25 October 2011 (DB) +// Last modified: 27 July 2012 (DB) // --------------------------------------------------------------------------- // Provides shared behavior for files & pipes // *************************************************************************** @@ -40,7 +40,7 @@ void ILocalIODevice::Close(void) { int64_t ILocalIODevice::Read(char* data, const unsigned int numBytes) { BT_ASSERT_X( m_stream, "ILocalIODevice::Read: trying to read from null stream" ); - BT_ASSERT_X( (m_mode == IBamIODevice::ReadOnly), "ILocalIODevice::Read: device not in read-only mode"); + BT_ASSERT_X( (m_mode & IBamIODevice::ReadOnly), "ILocalIODevice::Read: device not in read-able mode"); return static_cast( fread(data, sizeof(char), numBytes, m_stream) ); } @@ -51,6 +51,6 @@ int64_t ILocalIODevice::Tell(void) const { int64_t ILocalIODevice::Write(const char* data, const unsigned int numBytes) { BT_ASSERT_X( m_stream, "ILocalIODevice::Write: tryint to write to null stream" ); - BT_ASSERT_X( (m_mode == IBamIODevice::WriteOnly), "ILocalIODevice::Write: device not in write-only mode" ); + BT_ASSERT_X( (m_mode & IBamIODevice::WriteOnly), "ILocalIODevice::Write: device not in write-able mode" ); return static_cast( fwrite(data, sizeof(char), numBytes, m_stream) ); } -- 2.39.2