summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-02-15 14:27:53 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2012-02-15 14:27:53 +0000
commitea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3 (patch)
treeee199bcddbce3a1f32263dbe3ddbd0b64ad8c7ca /tools
parent1ea2c6a2f6165887568285c95c531c6905ee5328 (diff)
downloadlvm2-ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3.tar.gz
lvm2-ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3.tar.xz
lvm2-ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3.zip
Simplify with dm_strdup
Diffstat (limited to 'tools')
-rw-r--r--tools/dmsetup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 4025acc3..d6d9dcfe 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3654,11 +3654,10 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
_switches[SHOWKEYS_ARG]++;
if (ind == TABLE_ARG) {
_switches[TABLE_ARG]++;
- if (!(_table = dm_malloc(strlen(optarg + 1)))) {
+ if (!(_table = dm_strdup(optarg))) {
log_error("Could not allocate memory for table string.");
return 0;
}
- strcpy(_table, optarg);
}
if (ind == TREE_ARG)
_switches[TREE_ARG]++;