diff options
author | Eli Linden <eli@lindenlab.com> | 2010-04-15 14:13:00 -0700 |
---|---|---|
committer | Eli Linden <eli@lindenlab.com> | 2010-04-15 14:13:00 -0700 |
commit | 4fe28de53a7467809f791790bf889d36c93eaa0b (patch) | |
tree | e7220f530f1ce817ff092360dd87d83c82794ca8 /indra/llcommon/llapr.cpp | |
parent | 5b64be097f319d7d2f20e0b1fd803a3644544dc3 (diff) | |
parent | fed0e3376f24d3fbd036633a1d6916bef38a2d54 (diff) |
Merge
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; } |