Re: [ovs-dev] [bug15637 1/5] json: New function json_serialized_length().

2013-04-01 Thread Ben Pfaff
On Mon, Apr 01, 2013 at 09:41:19AM -0700, Justin Pettit wrote: > On Mar 27, 2013, at 2:44 PM, Ben Pfaff wrote: > > > +static size_t > > +json_string_serialized_length(const char *string) > > +{ > > +size_t length; > > +uint8_t c; > > + > > +/* "" */ > > +length = 2; > > I think t

Re: [ovs-dev] [bug15637 1/5] json: New function json_serialized_length().

2013-04-01 Thread Justin Pettit
On Mar 27, 2013, at 2:44 PM, Ben Pfaff wrote: > +static size_t > +json_string_serialized_length(const char *string) > +{ > +size_t length; > +uint8_t c; > + > +/* "" */ > +length = 2; I think this length represents the surrounding quotes, but until I looked at json_serialize_str

[ovs-dev] [bug15637 1/5] json: New function json_serialized_length().

2013-03-27 Thread Ben Pfaff
This will be used for the first time in an upcoming commit. Signed-off-by: Ben Pfaff --- lib/json.c| 125 - lib/json.h|4 +- tests/test-json.c |3 +- 3 files changed, 129 insertions(+), 3 deletions(-) diff --git a/lib/