diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-02-15 14:27:53 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-02-15 14:27:53 +0000 |
commit | ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3 (patch) | |
tree | ee199bcddbce3a1f32263dbe3ddbd0b64ad8c7ca /tools | |
parent | 1ea2c6a2f6165887568285c95c531c6905ee5328 (diff) | |
download | lvm2-ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3.tar.gz lvm2-ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3.tar.xz lvm2-ea7b3d8fd7e2a3b68cb1f6c3c2fc6bc43eb10ac3.zip |
Simplify with dm_strdup
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dmsetup.c | 3 |
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]++; |