This is the mail archive of the lvm2-cvs@sourceware.org mailing list for the LVM2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

LVM2/tools dmsetup.c


CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-15 14:27:53

Modified files:
	tools          : dmsetup.c 

Log message:
	Simplify with dm_strdup

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.180&r2=1.181

--- LVM2/tools/dmsetup.c	2012/02/15 14:20:59	1.180
+++ LVM2/tools/dmsetup.c	2012/02/15 14:27:53	1.181
@@ -3654,11 +3654,10 @@
 			_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]++;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]