From 0513501c11ca3bf9c453cd7b1041dfa34ebd9047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 Mar 2004 11:43:22 +0000 Subject: [PATCH] Fixed the file size check for the selection items - accidently compared blocks with bytes. Switched the block offset to using the "block" instead of "position" field in the kMsgPositionUpdate message. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6854 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/ProbeView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/diskprobe/ProbeView.cpp b/src/apps/diskprobe/ProbeView.cpp index 96a570c209..ecc1560c36 100644 --- a/src/apps/diskprobe/ProbeView.cpp +++ b/src/apps/diskprobe/ProbeView.cpp @@ -1432,8 +1432,8 @@ ProbeView::UpdateSelectionMenuItems(int64 start, int64 end) snprintf(buffer, sizeof(buffer), "Native: %Ld (0x%0*Lx)", position, size * 2, position); fNativeMenuItem->SetLabel(buffer); - fNativeMenuItem->SetEnabled(position >= 0 && position < fEditor.FileSize()); - fNativeMenuItem->Message()->ReplaceInt64("position", position * fEditor.BlockSize()); + fNativeMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize()); + fNativeMenuItem->Message()->ReplaceInt64("block", position); position = B_SWAP_INT64(position) >> (8 * (8 - size)); if (fDataView->Base() == kHexBase) @@ -1442,8 +1442,8 @@ ProbeView::UpdateSelectionMenuItems(int64 start, int64 end) snprintf(buffer, sizeof(buffer), "Swapped: %Ld (0x%0*Lx)", position, size * 2, position); fSwappedMenuItem->SetLabel(buffer); - fSwappedMenuItem->SetEnabled(position >= 0 && position < fEditor.FileSize()); - fSwappedMenuItem->Message()->ReplaceInt64("position", position * fEditor.BlockSize()); + fSwappedMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize()); + fSwappedMenuItem->Message()->ReplaceInt64("block", position); }