aboutsummaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-01-12 19:08:05 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-01-12 19:08:05 +0200
commit113bd7ee878ac2284c8c049fdb8dc2d2bd19f016 (patch)
treef38c617e54d763cee506c3314168bfb96a958f22 /generator
parent0f6b615ae3395734ee9a1b35185540acad18c452 (diff)
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.
Diffstat (limited to 'generator')
-rw-r--r--generator/nanopb_generator.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index e1d99c9..2ceafc7 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,'