Skip to content

leptjson.cpp中,lept_shrink_object函数有问题#241

Open
WangHao-nlp wants to merge 29 commits intomiloyip:masterfrom
coderhare:master
Open

leptjson.cpp中,lept_shrink_object函数有问题#241
WangHao-nlp wants to merge 29 commits intomiloyip:masterfrom
coderhare:master

Conversation

@WangHao-nlp
Copy link

void lept_shrink_object(lept_value* v) {
assert(v != NULL && v->type == LEPT_OBJECT);
/* \todo */
if(v->u.o.capacity > v->u.o.size) {
v->u.o.capacity = v->u.o.size;
// 原来v->u.o.m = (lept_member *)realloc(v->u.o.m, v->u.o.capacity * sizeof(lept_value));
// 应该为
v->u.o.m = (lept_member *)realloc(v->u.o.m, v->u.o.capacity * sizeof(lept_member));
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants