Skip to contentSkip to conversation

boolian logic bug in vgremove

PATCH Andre Noll 2 participants 2 messages Jan 31, 2007 Device mapper

lore
Share & tools
lore

Andre Noll

author
#0 lore raw

Hi

In the argument checking code of vgreduce.c there are two occasions of '&' that really should be '&&'. Patch below.

Signed-off.by: Andre Noll <[email protected]>
---
Index: vgreduce.c
===================================================================
RCS file: /cvs/lvm2/LVM2/tools/vgreduce.c,v
retrieving revision 1.55

vgreduce.c +2 -2
diff -u -r1.55 vgreduce.c
@@ -427,13 +427,13 @@
 	int ret = 1;
 	int consistent = 1;
 
-	if (!argc & !arg_count(cmd, removemissing_ARG)) {
+	if (!argc && !arg_count(cmd, removemissing_ARG)) {
 		log_error("Please give volume group name and "
 			  "physical volume paths");
 		return EINVALID_CMD_LINE;
 	}
 
-	if (!argc & arg_count(cmd, removemissing_ARG)) {
+	if (!argc && arg_count(cmd, removemissing_ARG)) {
 		log_error("Please give volume group name");
 		return EINVALID_CMD_LINE;
 	}

Andre

Signature · 1 line
The only person who always got his work done by Friday was Robinson Crusoe
#1 lore raw
Quoted 2 lines · Andre Noll

In the argument checking code of vgreduce.c there are two occasions of '&' that really should be '&&'. Patch below.

Well-spotted - apparently it's been like that for 4 years!

Alasdair

Signature · 1 line
[email protected]