Fixed incorrect return value of _user_get_file_disk_device_path().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33382 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-10-01 03:03:56 +00:00
parent c51d6579e4
commit 80ea5e3508
1 changed files with 5 additions and 1 deletions

View File

@ -456,7 +456,11 @@ _user_get_file_disk_device_path(partition_id id, char* buffer,
if (fileDevice == NULL)
return B_BAD_VALUE;
return user_strlcpy(buffer, fileDevice->FilePath(), bufferSize);
ssize_t copied = user_strlcpy(buffer, fileDevice->FilePath(),
bufferSize);
if (copied < 0)
return copied;
return (size_t)copied < bufferSize ? B_OK : B_BUFFER_OVERFLOW;
}
}