* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
rc = llapi_file_get_stripe(argv[1], lum_dir);
if (rc == -ENODATA) {
- char root[PATH_MAX];
+ char root[PATH_MAX], path[PATH_MAX + 2];
rc = llapi_search_mounts(argv[1], 0, root, NULL);
if (rc) {
goto cleanup;
}
- strlcat(root, "/.", PATH_MAX);
- rc = llapi_file_get_stripe(root, lum_dir);
+ snprintf(path, sizeof(path), "%s/.", root);
+ rc = llapi_file_get_stripe(path, lum_dir);
if (rc == -ENODATA) {
free(lum_dir);
lum_dir = NULL;
} else if (rc) {
llapi_error(LLAPI_MSG_ERROR, rc, "error: cant't get "
- "root's LOVEA for %s\n", root);
+ "root's LOVEA for %s\n", path);
goto cleanup;
}
} else if (rc) {