mirror of
https://github.com/rafagafe/tiny-json.git
synced 2025-03-12 19:25:30 +00:00
removed strlen also because it to the same problems of strcmp and changed to strnlen
This commit is contained in:
parent
6a3c3cb437
commit
cdaeed5c56
@ -44,9 +44,11 @@ typedef struct jsonStaticPool_s {
|
||||
json_t const* json_getProperty( json_t const* obj, char const* property ) {
|
||||
json_t const* sibling;
|
||||
for( sibling = obj->u.c.child; sibling; sibling = sibling->sibling ){
|
||||
if (strlen(property)>MAX_PROPERTY_SIZE)
|
||||
if (strnlen (property,MAX_PROPERTY_SIZE)==MAX_PROPERTY_SIZE)
|
||||
{
|
||||
return 0;
|
||||
if (property[MAX_PROPERTY_SIZE] !='\0'){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ( sibling->name && !strncmp( sibling->name, property,MAX_PROPERTY_SIZE) ){
|
||||
|
Loading…
Reference in New Issue
Block a user