[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] LVM2/tools toollib.c



CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]