Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare of two array #180

Closed
zhengqb opened this issue Jun 13, 2017 · 5 comments
Closed

compare of two array #180

zhengqb opened this issue Jun 13, 2017 · 5 comments
Labels

Comments

@zhengqb
Copy link

zhengqb commented Jun 13, 2017

Hi, in function cJSON_Compare(), it seems like that when comparing two arrays, if one of them is shorter than the other, but all the elements of the shorter array are equal to the longer one, the function returns that the two arrays are equal, is that right?

@FSMaxB FSMaxB added the bug label Jun 13, 2017
@FSMaxB
Copy link
Collaborator

FSMaxB commented Jun 13, 2017

You're right. This is a bug. Thanks for reporting this.

@FSMaxB
Copy link
Collaborator

FSMaxB commented Jun 13, 2017

It's the same thing for objects as well.

@FSMaxB
Copy link
Collaborator

FSMaxB commented Jun 13, 2017

Looks like fixing this revealed some bugs in cJSON_Utils as well.

@FSMaxB
Copy link
Collaborator

FSMaxB commented Jun 13, 2017

I'll need some time to fix the bugs in cJSON_Utils, after that I will make a new bugfix release.

FSMaxB added a commit that referenced this issue Jun 13, 2017
It did consider two arrays equal if one is a prefix of the other one,
which is incorrect.

See #180
FSMaxB added a commit that referenced this issue Jun 13, 2017
It did consider two arrays equal if one is a subset of te other one,
which is incorrect.

See #180
FSMaxB added a commit to FSMaxB/cJSON that referenced this issue Jun 14, 2017
It did consider two arrays equal if one is a prefix of the other one,
which is incorrect.

See DaveGamble#180
FSMaxB added a commit to FSMaxB/cJSON that referenced this issue Jun 14, 2017
It did consider two arrays equal if one is a subset of te other one,
which is incorrect.

See DaveGamble#180
@FSMaxB
Copy link
Collaborator

FSMaxB commented Jun 14, 2017

This is now fixed in version 1.5.5

@FSMaxB FSMaxB closed this as completed Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants