Banned strncpy(), switched return type from "int" to "status_t" for vfs_get_vnode_from_path().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6693 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7d5be143e8
commit
0d6f9a67e5
@ -1345,23 +1345,23 @@ vfs_get_vnode_from_fd(int fd, bool kernel, void **vnode)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
status_t
|
||||
vfs_get_vnode_from_path(const char *path, bool kernel, void **_vnode)
|
||||
{
|
||||
struct vnode *vnode;
|
||||
int err;
|
||||
char buf[SYS_MAX_PATH_LEN+1];
|
||||
status_t status;
|
||||
char buffer[SYS_MAX_PATH_LEN + 1];
|
||||
|
||||
PRINT(("vfs_get_vnode_from_path: entry. path = '%s', kernel %d\n", path, kernel));
|
||||
|
||||
strncpy(buf, path, SYS_MAX_PATH_LEN);
|
||||
buf[SYS_MAX_PATH_LEN] = 0;
|
||||
strlcpy(buffer, path, sizeof(buffer));
|
||||
|
||||
err = path_to_vnode(buf, true, &vnode, kernel);
|
||||
if (err >= 0)
|
||||
*_vnode = vnode;
|
||||
status = path_to_vnode(buffer, true, &vnode, kernel);
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
|
||||
return err;
|
||||
*_vnode = vnode;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user