BFS: Fixed readdir() again.

* We still need to return B_BUFFER_OVERFLOW if the passed in buffer was
  smaller than INODE_FILE_NAME_LENGTH, as that's what must be expected
  from the caller.
This commit is contained in:
Axel Dörfler
2017-04-14 14:39:20 +02:00
parent 5bb8320035
commit 3431d8f20e
@@ -2744,7 +2744,7 @@ TreeIterator::Traverse(int8 direction, void* key, uint16* keyLength,
// include the termination for string types
bool needsTermination = fTree->fHeader.DataType() == BPLUSTREE_STRING_TYPE;
if (length + (needsTermination ? 1 : 0) > maxLength) {
if (!needsTermination) {
if (!needsTermination || maxLength < INODE_FILE_NAME_LENGTH) {
// The buffer is too small, restore the last key and return
// an error
fCurrentNodeOffset = savedNodeOffset;