From 2ad0108fbee46a7d8f571390e9b5a1c19bace89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 25 Nov 2002 18:43:11 +0000 Subject: [PATCH] Now uses Inode::GetName() and strlcpy(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2086 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_systems/bfs/BlockAllocator.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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