summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-09-07 19:49:00 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-09-07 19:49:00 +0300
commitcdbf51db08d86ea024605078f21e8c61fe0e5fd3 (patch)
tree22dfad0e12c5b4a3c0a925b507bc598151b36ef6 /generator
parentd0299d87ec109c83480f857d2a1ce66d52834926 (diff)
Fix compilation error with generated initializers for repeated pointer fields
Diffstat (limited to 'generator')
-rwxr-xr-xgenerator/nanopb_generator.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 56dfdb08..9ffed03a 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -596,6 +596,8 @@ class Message:
else:
parts.append(field.get_initializer(null_init))
elif field.allocation == 'POINTER':
+ if field.rules == 'REPEATED':
+ parts.append('0')
parts.append('NULL')
elif field.allocation == 'CALLBACK':
if field.pbtype == 'EXTENSION':