aboutsummaryrefslogtreecommitdiff
path: root/tests/zfs-tests/cmd/dir_rd_update.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/cmd/dir_rd_update.c')
-rw-r--r--tests/zfs-tests/cmd/dir_rd_update.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/zfs-tests/cmd/dir_rd_update.c b/tests/zfs-tests/cmd/dir_rd_update.c
index 0f460fbecdc2..c0d283105a92 100644
--- a/tests/zfs-tests/cmd/dir_rd_update.c
+++ b/tests/zfs-tests/cmd/dir_rd_update.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -63,13 +63,12 @@ main(int argc, char **argv)
}
cp1 = argv[1];
- if (strlen(cp1) >= (sizeof (dirpath) - strlen("TMP_DIR"))) {
+ if (strlen(cp1) >= (sizeof (dirpath) - strlen("/TMP_DIR"))) {
(void) printf("The string length of mount point is "
"too large\n");
exit(-1);
}
- (void) strcpy(&dirpath[0], (const char *)cp1);
- (void) strcat(&dirpath[strlen(dirpath)], "TMP_DIR");
+ (void) snprintf(dirpath, sizeof (dirpath), "%s/TMP_DIR", cp1);
ret = mkdir(dirpath, 0777);
if (ret != 0) {