summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
Diffstat (limited to 'generator')
-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))