Skip to content

Commit

Permalink
bfs: fixed wrong key comparison in validator.
Browse files Browse the repository at this point in the history
* bplustree_header::DataType() is not compatible with the type constants
  compareKeys() expects. Use _CompareKeys() instead.
  • Loading branch information
axeld committed Jul 9, 2014
1 parent e35fa24 commit ba32021
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2012, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2001-2014, Axel Dörfler, axeld@pinc-software.de.
* This file may be used under the terms of the MIT License.
*
* Roughly based on 'btlib' written by Marcus J. Ranum - it shares
Expand Down Expand Up @@ -2362,8 +2362,8 @@ BPlusTree::_ValidateChildren(TreeCheck& check, uint32 level, off_t offset,
uint16 keyLength;
uint8* key = parent->KeyAt(i, &keyLength);
if (largestKey != NULL) {
int result = compareKeys(fHeader.DataType(), key, keyLength,
largestKey, largestKeyLength);
int result = _CompareKeys(key, keyLength, largestKey,
largestKeyLength);
if (result >= 0) {
dprintf("inode %" B_PRIdOFF ": node %" B_PRIdOFF " key %"
B_PRIu32 " larger than it should!\n",
Expand Down

0 comments on commit ba32021

Please sign in to comment.