diff options
author | Jim Meyering <meyering@redhat.com> | 2012-04-20 21:27:23 +0200 |
---|---|---|
committer | Hugo Mills <hugo@carfax.org.uk> | 2012-06-05 19:56:20 +0100 |
commit | 6fc24e4a701397ca2bfc4bfc8dd5da813f9ab24d (patch) | |
tree | a8e8c558f9b7bb4dc61d81c21b2fd52dc4b83458 | |
parent | 0195702a0963619f833e2286a98251f841e66047 (diff) |
mkfs: use strdup in place of strlen,malloc,strcpy sequence
* mkfs.c (traverse_directory): No semantic change.
Reviewed-by: Josef Bacik <josef@redhat.com>
-rw-r--r-- | mkfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -911,8 +911,7 @@ static int traverse_directory(struct btrfs_trans_handle *trans, /* Add list for source directory */ dir_entry = malloc(sizeof(struct directory_name_entry)); dir_entry->dir_name = dir_name; - dir_entry->path = malloc(strlen(dir_name) + 1); - strcpy(dir_entry->path, dir_name); + dir_entry->path = strdup(dir_name); parent_inum = highest_inum + BTRFS_FIRST_FREE_OBJECTID; dir_entry->inum = parent_inum; |