diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2017-02-20 15:47:44 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2017-02-20 15:47:44 +0200 |
commit | ca74746e23b5a9e7916e8fde6632d71d61603f50 (patch) | |
tree | 7f52b0d716c54f55532c90aa931d8305b1a88ba9 /tests | |
parent | 473816c66b559be6850fc1ef753a7141d1848300 (diff) |
Add new option max_length for strings (issue #107)
Max_size is the allocated size, so users had to add +1 for
the null terminator. Max_length does the +1 automatically
in the generator.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/options/options.expected | 1 | ||||
-rw-r--r-- | tests/options/options.proto | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/options/options.expected b/tests/options/options.expected index 0769880a..9e47e6a4 100644 --- a/tests/options/options.expected +++ b/tests/options/options.expected @@ -1,6 +1,7 @@ char filesize\[20\]; char msgsize\[30\]; char fieldsize\[40\]; +char fieldlen\[41\]; pb_callback_t int32_callback; \sEnumValue1 = 1 Message5_EnumValue1 diff --git a/tests/options/options.proto b/tests/options/options.proto index 89bb086f..c6ca5e25 100644 --- a/tests/options/options.proto +++ b/tests/options/options.proto @@ -26,6 +26,7 @@ message Message3 { option (nanopb_msgopt).msgid = 103; required string fieldsize = 1 [(nanopb).max_size = 40]; + required string fieldlen = 2 [(nanopb).max_length = 40]; } // Forced callback field |