Files
nanopb/tests/unittestproto.proto
Petteri Aimonen d2063ff0b6 Handle unterminated strings when encoding.
If the null terminator is not present, string will be limited to the
data size of the field.

If you are still using the pb_enc_string (deprecated since 0.1.3) from
callbacks, now would be an excellent time to stop. The pb_field_t for
the callback will not contain proper data_size. Use pb_encode_string()
instead.

Update issue 68
Status: FixedInGit
2013-04-14 09:46:39 +03:00

33 lines
706 B
Protocol Buffer

import 'nanopb.proto';
message IntegerArray {
repeated int32 data = 1 [(nanopb).max_count = 10];
}
message FloatArray {
repeated float data = 1 [(nanopb).max_count = 10];
}
message StringMessage {
required string data = 1 [(nanopb).max_size = 10];
}
message CallbackArray {
// We cheat a bit and use this message for testing other types, too.
// Nanopb does not care about the actual defined data type for callback
// fields.
repeated int32 data = 1;
}
message IntegerContainer {
required IntegerArray submsg = 1;
}
message CallbackContainer {
required CallbackArray submsg = 1;
}
message CallbackContainerContainer {
required CallbackContainer submsg = 1;
}