Skip to content

Commit c0c677a

Browse files
author
James McLaughlin
committed
Correct assert conditions for json_object_push and json_array_push
1 parent 0fcf401 commit c0c677a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

json-builder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ json_value * json_array_new (size_t length)
113113

114114
json_value * json_array_push (json_value * array, json_value * value)
115115
{
116-
assert (value->type == json_array);
116+
assert (array->type == json_array);
117117

118118
if (((json_builder_value *) value)->additional_length_allocated > 0)
119119
{
@@ -172,7 +172,7 @@ json_value * json_object_push_length (json_value * object,
172172
{
173173
json_char * name_copy;
174174

175-
assert (value->type == json_object);
175+
assert (object->type == json_object);
176176

177177
if (! (name_copy = (json_char *) malloc ((name_length + 1) * sizeof (json_char))))
178178
return NULL;
@@ -195,7 +195,7 @@ json_value * json_object_push_nocopy (json_value * object,
195195
{
196196
json_object_entry * entry;
197197

198-
assert (value->type == json_object);
198+
assert (object->type == json_object);
199199

200200
if (((json_builder_value *) value)->additional_length_allocated > 0)
201201
{

0 commit comments

Comments
 (0)