[PATCH 1/2] tools: Fix comparison between signed and unsigned integer

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

 



len is non-negative here, so we can safely cast it to size_t.
---
 tools/bluemoon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bluemoon.c b/tools/bluemoon.c
index c785472..0f32d63 100644
--- a/tools/bluemoon.c
+++ b/tools/bluemoon.c
@@ -767,7 +767,7 @@ static void analyze_firmware(const char *path)
 	printf("\n");
 
 
-	if (len != le32_to_cpu(css->size) * 4) {
+	if ((size_t) len != le32_to_cpu(css->size) * 4) {
 		fprintf(stderr, "CSS.size does not match file length\n");
 		goto done;
 	}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux