LVM2/tools toollib.c

[email protected] <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <[email protected]>
CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2010-10-25 12:08:16

Modified files:
	tools          : toollib.c 

Log message:
	Reuse result of previous strchr
	
	Reported by clang as: Argument with 'nonnull' attribute passed null
	
	Reuse the result of the last strchr() call - make sure, 'st' point is not
	null for the next strchr() call.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.209&r2=1.210

--- LVM2/tools/toollib.c	2010/09/23 12:02:34	1.209
+++ LVM2/tools/toollib.c	2010/10/25 12:08:15	1.210
@@ -869,7 +869,7 @@
 			while (*st == '/')
 				st++;
 
-		if (!strchr(vg_name, '/') || strchr(st, '/')) {
+		if (!st || strchr(st, '/')) {
 			log_error("\"%s\": Invalid path for Logical Volume",
 				  lv_name);
 			return 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.