* Removed +1 in calculating utf string length as the null char was already included

* Improved debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27175 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Salvatore Benedetto 2008-08-23 13:00:51 +00:00
parent c5855c9ef4
commit 0650565811
2 changed files with 17 additions and 16 deletions

View File

@ -81,7 +81,7 @@ AllocationDescriptorList<Accessor>::AllocationDescriptorList(Icb *icb,
fReadFromIcb(true),
fVolume(icb->GetVolume())
{
TRACE(("AllocationDescriptorList<>\n"));
TRACE(("AllocationDescriptorList<>::AllocationDescriptorList\n"));
_WalkContinuationChain(_CurrentDescriptor());
}
@ -101,7 +101,7 @@ status_t
AllocationDescriptorList<Accessor>::FindExtent(off_t start,
long_address *extent, bool *isEmpty)
{
TRACE(("UDF: AllocationDescriptorList<>::FindExtent: start: %Ld, "
TRACE(("AllocationDescriptorList<>::FindExtent: start: %Ld, "
"extent: %p, isEmpty: %p\n", start, extent, isEmpty));
off_t startBlock = start >> fVolume->BlockShift();
@ -149,11 +149,12 @@ template<class Accessor>
AllocationDescriptorList<Accessor>::Descriptor*
AllocationDescriptorList<Accessor>::_CurrentDescriptor() const
{
TRACE(("AllocationDescriptorList<>::_CurrentDescriptor: "
"_DescriptorIndex() + 1) * sizeof(Descriptor) = %ld\n",
"\t_DescriptorArraySize() = %ld\n\t_DescriptorArray() = %p\n",
(_DescriptorIndex() + 1) * sizeof(Descriptor), _DescriptorArraySize(),
_DescriptorArray()));
TRACE(("AllocationDescriptorList<>::_CurrentDescriptor:\n"
"\t_DescriptorIndex() + 1 * sizeof(Descriptor) = %ld\n"
"\t_DescriptorArraySize() = %ld\n"
"\t_DescriptorArray() = %p\n",
(_DescriptorIndex() + 1) * sizeof(Descriptor),
_DescriptorArraySize(), _DescriptorArray()));
return ((_DescriptorIndex() + 1) * sizeof(Descriptor)
<= _DescriptorArraySize())
@ -196,6 +197,8 @@ template<class Accessor>
void
AllocationDescriptorList<Accessor>::_WalkContinuationChain(Descriptor *descriptor)
{
TRACE(("AllocationDescriptorList<>::_WalkContinuationChain: descriptor = %p\n",
descriptor));
if (descriptor
&& fAccessor.GetType(*descriptor) == EXTENT_TYPE_CONTINUATION) {
// Load the new block, make sure we're not trying

View File

@ -15,15 +15,13 @@
status_t
DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
{
TRACE(("DirectoryIterator::GetNextEntry: name = %s, length = %ld, id = %p\n",
name, *length, id));
{
if (!id || !name || !length)
return B_BAD_VALUE;
TRACE(("\tfPosition: %Ld\n", fPosition));
TRACE(("\tParent()->Length(): %Ld\n", Parent()->Length()));
TRACE(("DirectoryIterator::GetNextEntry: name = %s, length = %ld, "
"id = %p, position = %Ld, parent length = %Ld\n", name, *length, id,
fPosition, Parent()->Length()));
status_t status = B_OK;
if (fAtBeginning) {
@ -57,12 +55,12 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
sprintf(name, "..");
*length = 3;
} else {
TRACE(("DirectoryIterator::GetNextEntry: UfdString\n"));
UdfString string(entry->id(), entry->id_length());
TRACE(("\tid == `%s'\n", string.Utf8()));
TRACE(("DirectoryIterator::GetNextEntry: UfdString id == `%s', "
"length = %d\n", string.Utf8(), string.Utf8Length()));
DUMP(entry->icb());
sprintf(name, "%s", string.Utf8());
*length = string.Utf8Length() + 1;
*length = string.Utf8Length();
}
*id = to_vnode_id(entry->icb());
}