From ca74746e23b5a9e7916e8fde6632d71d61603f50 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Mon, 20 Feb 2017 15:47:44 +0200 Subject: 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. --- tests/options/options.proto | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/options/options.proto') 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 -- cgit 1.2.3-korg