mjson icon indicating copy to clipboard operation
mjson copied to clipboard

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

Open hyansuper opened this issue 1 year ago • 0 comments

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"

hyansuper avatar Dec 11 '23 14:12 hyansuper