1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-09 01:18:39 +03:00

Simplify with dm_strdup

This commit is contained in:
Zdenek Kabelac 2012-02-15 14:27:53 +00:00
parent 580b0e871d
commit d11718e479

View File

@ -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]++;