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

Suggest using bool type instead of int in function mjson_get_bool() #69

Open
hyansuper opened this issue Dec 11, 2023 · 0 comments
Open

Comments

@hyansuper
Copy link

hyansuper commented Dec 11, 2023

because sizeof(bool) is not the same as sizeof(int), If someone put a bool var as the last param into funciton int mjson_get_bool(const char *s, int len, const char *path, int *v), adjacent memory with bool var may be overwritten.

So I suggest change the function to signature to int mjson_get_bool(const char *s, int len, const char *path, bool* b) since the name says "get bool"

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

No branches or pull requests

1 participant