don't yell if file is not open

This commit is contained in:
David Rose 2008-10-23 23:51:30 +00:00
parent 2818627d72
commit be4f9efc17
1 changed files with 2 additions and 2 deletions

View File

@ -448,7 +448,7 @@ underflow() {
////////////////////////////////////////////////////////////////////
size_t PandaFileStreamBuf::
read_chars(char *start, size_t length) {
if (length == 0) {
if (length == 0 || !_is_open) {
// Trivial no-op.
return 0;
}
@ -641,7 +641,7 @@ read_chars_raw(char *start, size_t length) {
////////////////////////////////////////////////////////////////////
size_t PandaFileStreamBuf::
write_chars_raw(const char *start, size_t length) {
if (length == 0) {
if (length == 0 || !_is_open) {
return 0;
}