From ece4feca93b91d8adc2bc2d0b71328db54a7cb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 6 Oct 2005 20:40:00 +0000 Subject: [PATCH] Use snprintf() instead of sprintf(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14333 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index 3b8e1167a8..d68a872f1f 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -178,8 +178,9 @@ Inode::Inode(Volume *volume, vnode_id id) NodeGetter node(volume, this); memcpy(&fNode, node.Node(), sizeof(bfs_inode)); - char lockName[32]; - sprintf(lockName, "bfs inode %ld.%d", BlockRun().AllocationGroup(), BlockRun().Start()); + char lockName[B_OS_NAME_LENGTH]; + snprintf(lockName, sizeof(lockName), "bfs inode %ld.%d", + BlockRun().AllocationGroup(), BlockRun().Start()); fLock.Initialize(lockName); // these two will help to maintain the indices @@ -204,8 +205,9 @@ Inode::Inode(Volume *volume, Transaction &transaction, vnode_id id, mode_t mode, PRINT(("Inode::Inode(volume = %p, transaction = %p, id = %Ld) @ %p\n", volume, &transaction, id, this)); - char lockName[32]; - sprintf(lockName, "bfs inode %ld.%d", run.AllocationGroup(), run.Start()); + char lockName[B_OS_NAME_LENGTH]; + snprintf(lockName, sizeof(lockName), "bfs inode %ld.%d", + BlockRun().AllocationGroup(), BlockRun().Start()); fLock.Initialize(lockName); NodeGetter node(volume, transaction, this, true);