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:
@@ -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)
|
vfs_get_vnode_from_path(const char *path, bool kernel, void **_vnode)
|
||||||
{
|
{
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
int err;
|
status_t status;
|
||||||
char buf[SYS_MAX_PATH_LEN+1];
|
char buffer[SYS_MAX_PATH_LEN + 1];
|
||||||
|
|
||||||
PRINT(("vfs_get_vnode_from_path: entry. path = '%s', kernel %d\n", path, kernel));
|
PRINT(("vfs_get_vnode_from_path: entry. path = '%s', kernel %d\n", path, kernel));
|
||||||
|
|
||||||
strncpy(buf, path, SYS_MAX_PATH_LEN);
|
strlcpy(buffer, path, sizeof(buffer));
|
||||||
buf[SYS_MAX_PATH_LEN] = 0;
|
|
||||||
|
|
||||||
err = path_to_vnode(buf, true, &vnode, kernel);
|
status = path_to_vnode(buffer, true, &vnode, kernel);
|
||||||
if (err >= 0)
|
if (status < B_OK)
|
||||||
*_vnode = vnode;
|
return status;
|
||||||
|
|
||||||
return err;
|
*_vnode = vnode;
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user