From 248d79bb0ee16bddcf48ad67aa1db1f017656e6d Mon Sep 17 00:00:00 2001 From: Alina Lenk Date: Wed, 20 Jul 2022 18:40:32 +0200 Subject: [PATCH 13/13] generate_packets.py: Don't compare constant array size to itself Reported by Marko Lindqvist See osdn#45159 Signed-off-by: Alina Lenk --- common/generate_packets.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/generate_packets.py b/common/generate_packets.py index 28a668841f..68ab7e4212 100755 --- a/common/generate_packets.py +++ b/common/generate_packets.py @@ -599,9 +599,17 @@ differ = (old->{self.name} != real_packet->{self.name}); else: c = "old->{self.name}[i] != real_packet->{self.name}[i]".format(self = self) - return """\ + if self.sizes[0].real != self.sizes[0].declared: + head = """\ differ = ({self.sizes[0].old} != {self.sizes[0].real}); if (!differ) {{ +""".format(self = self) + else: + head = """\ +differ = FALSE; +{ +""" + return head + """\ int i; for (i = 0; i < {self.sizes[0].real}; i++) {{ -- 2.34.1