diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index fffd557e09..7121bce201 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -798,8 +798,9 @@ BlockAllocator::CheckNextNode(check_control *control) control->errors = 0; control->status = CheckInode(inode, control); - const char *name = inode->Name(); - strcpy(control->name, name ? name : "(node has no name)"); + if (inode->GetName(control->name) < B_OK) + strcpy(control->name, "(node has no name)"); + control->inode = inode->ID(); control->mode = inode->Mode(); @@ -826,7 +827,7 @@ BlockAllocator::CheckNextNode(check_control *control) continue; // fill in the control data as soon as we have them - strcpy(control->name, name); + strlcpy(control->name, name, B_FILE_NAME_LENGTH); control->inode = id; control->errors = 0; @@ -848,10 +849,6 @@ BlockAllocator::CheckNextNode(check_control *control) } } - strcpy(control->name, name ? name : "(node has no name)"); - control->inode = inode->ID(); - control->mode = inode->Mode(); - control->mode = inode->Mode(); // Check for the correct mode of the node (if the mode of the