From 113bd7ee878ac2284c8c049fdb8dc2d2bd19f016 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 12 Jan 2012 19:08:05 +0200 Subject: Fixed issue 1 reported by Erik Rosen: The size of non-callback bytes-fields was miscalculated, which caused all following fields in a message to contain garbage. Previous commit contains a testcase for this. This fix changes the generated message description. If your protocol uses bytes-fields, you should regenerate *.pb.c. --- generator/nanopb_generator.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'generator') diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index e1d99c97..2ceafc7e 100644 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -219,9 +219,6 @@ class Field: result += '\n pb_membersize(%s, %s[0]),' % (self.struct_name, self.name) result += ('\n pb_membersize(%s, %s) / pb_membersize(%s, %s[0]),' % (self.struct_name, self.name, self.struct_name, self.name)) - elif self.htype != 'PB_HTYPE_CALLBACK' and self.ltype == 'PB_LTYPE_BYTES': - result += '\n pb_membersize(%s, bytes),' % self.ctype - result += ' 0,' else: result += '\n pb_membersize(%s, %s),' % (self.struct_name, self.name) result += ' 0,' -- cgit 1.2.3-korg