Menu

#16 Bad error message in XFile::SetLength

open
nobody
None
5
2003-10-15
2003-10-15
Chris Waco
No

void XFile::SetLength(uint64 newSize) {
...
if (newSize > LLONG_MAX) {
std::wstring mesg = LoadWhisperString(L"File #1's length
is over 32 bits.", mSpec.GetName());
throw std::range_error(ToUTF8Str(mesg));
}
...
}

The error message says "length is over 32 bits", but there's
a 64-bit number being passed in and it is checked against
the max value for a long long. The message should say
something more like:

"Request to change the length of File #1 is out of range"
or
"File #1's length is over 63 bits"

Discussion


Log in to post a comment.

MongoDB Logo MongoDB