summaryrefslogtreecommitdiff
path: root/tests.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-02-26 01:55:39 -0800
committerJoshua Haberman <joshua@reverberate.org>2009-02-26 01:55:39 -0800
commitd351981f9e4f9ef5184e35e98ad14df305c91def (patch)
tree5deaeef0e49637fa2c35dd853a7598f0b59f98ca /tests.c
parente67f5d5f02a6b5529d2a1a27b7e729bce853f337 (diff)
Change to a fixed stack size.
Proto2 only allows a nesting depth of 64, so we follow suit.
Diffstat (limited to 'tests.c')
-rw-r--r--tests.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests.c b/tests.c
index eaf703f..7a6e51b 100644
--- a/tests.c
+++ b/tests.c
@@ -47,7 +47,7 @@ void test_simple_proto()
/* These are the examples from
* http://code.google.com/apis/protocolbuffers/docs/encoding.html */
struct pbstream_fieldset *fieldset1 = malloc(sizeof(*fieldset1) +
- 2*sizeof(struct pbstream_field));
+ sizeof(struct pbstream_field[2]));
fieldset1->num_fields = 2;
fieldset1->fields[0].field_number = 1;
fieldset1->fields[0].type = PBSTREAM_TYPE_INT32;
@@ -79,7 +79,7 @@ void test_simple_proto()
pbstream_free_parser(&s);
struct pbstream_fieldset *fieldset2 = malloc(sizeof(*fieldset1) +
- 3*sizeof(struct pbstream_field));
+ sizeof(struct pbstream_field[3]));
fieldset2->num_fields = 3;
fieldset2->fields[2].field_number = 3;
fieldset2->fields[2].type = PBSTREAM_TYPE_MESSAGE;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback