summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-10-23 21:21:43 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-10-23 21:21:43 +0300
commit51f0e47295d537a113804f250cddef37a57237a8 (patch)
treeeb3335a28111e5ada1930918469c9904f1f99868
parent49bd3f35a0b6db0fa47d2e6e8fe9ddfb1bbcd58b (diff)
Fix the size of length prefix for messages in other files.
-rwxr-xr-xgenerator/nanopb_generator.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index ebb020b7..0f14a041 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -355,6 +355,11 @@ class Field:
# Instead of direct numeric value, reference the size that
# has been #defined in the other file.
encsize = EncodedSize(self.submsgname + 'size')
+
+ # We will have to make a conservative assumption on the length
+ # prefix size, though.
+ encsize += 5
+
elif self.enc_size is None:
raise RuntimeError("Could not determine encoded size for %s.%s"
% (self.struct_name, self.name))