* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38416 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-28 14:35:48 +00:00
parent da0d740954
commit be136723e7

View File

@ -1265,18 +1265,19 @@ Inode::AddAttribute(Attribute* attribute, bool overwrite)
status_t
Inode::AddAttribute(const char* name, type_code type,
bool overwrite, const uint8* data, size_t length)
Inode::AddAttribute(const char* name, type_code type, bool overwrite,
const uint8* data, size_t length)
{
Attribute* attribute = new Attribute(name, type);
status_t status = attribute != NULL ? B_OK : B_NO_MEMORY;
if (status == B_OK)
status = attribute->InitCheck();
if (attribute == NULL)
return B_NO_MEMORY;
status_t status = attribute->InitCheck();
if (status == B_OK && data != NULL && length != 0)
status = attribute->WriteAt(0, data, &length);
if (status == B_OK)
status = AddAttribute(attribute, overwrite);
if (status < B_OK) {
if (status != B_OK) {
delete attribute;
return status;
}