r5917 - trunk/src/host/dfu-util/src

alphaone at docs.openmoko.org alphaone at docs.openmoko.org
Mon Apr 19 00:01:19 CEST 2010


Author: alphaone
Date: 2010-04-19 00:01:19 +0200 (Mon, 19 Apr 2010)
New Revision: 5917

Modified:
   trunk/src/host/dfu-util/src/main.c
Log:
Correctly fix problem introduced by revision 5910

!dif->flags & (DFU_IFF_IFACE|DFU_IFF_ALT) is supposed to check if
neither the flags DFU_IFF_IFACE or DFU_IFF_ALT are set. The problem is
that ! has higher precedence than &. The parentheses (which are always
good if they improve readability) solve the problem.


Modified: trunk/src/host/dfu-util/src/main.c
===================================================================
--- trunk/src/host/dfu-util/src/main.c	2010-04-18 19:06:33 UTC (rev 5916)
+++ trunk/src/host/dfu-util/src/main.c	2010-04-18 22:01:19 UTC (rev 5917)
@@ -707,7 +707,7 @@
 				"DFU IF\n");
 			exit(1);
 		}
-	} else if (num_ifs > 1 && !dif->flags && (DFU_IFF_IFACE|DFU_IFF_ALT)) {
+	} else if (num_ifs > 1 && !(dif->flags & (DFU_IFF_IFACE|DFU_IFF_ALT))) {
 		fprintf(stderr, "We have %u DFU Interfaces/Altsettings, "
 			"you have to specify one via --intf / --alt options\n",
 			num_ifs);




More information about the commitlog mailing list