diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-15 20:39:00 +0100 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-15 20:39:00 +0100 |
| commit | 230314ac71a055458d9bff4fae744b8e25f7ada2 (patch) | |
| tree | 35bcab18d57eda2c5f3665e287b06b2d8b7060cd /indra/llcommon/llapr.cpp | |
| parent | 90800c84c4836d2eb0425ed09b7dd83e86a106db (diff) | |
| parent | 12dadac44e9d5af8728e7bedab586683b2660cb4 (diff) | |
merge from viewer-trunk
Diffstat (limited to 'indra/llcommon/llapr.cpp')
| -rw-r--r-- | indra/llcommon/llapr.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index ed70b1d9f2..7330b00bcf 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -543,14 +543,13 @@ S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nb return 0; } - S32 off; - if (offset < 0) - off = LLAPRFile::seek(file_handle, APR_END, 0); - else - off = LLAPRFile::seek(file_handle, APR_SET, offset); + llassert(offset >= 0); + + if (offset > 0) + offset = LLAPRFile::seek(file_handle, APR_SET, offset); apr_size_t bytes_read; - if (off < 0) + if (offset < 0) { bytes_read = 0; } |
