Changeset 67ebc8e for lib


Ignore:
Timestamp:
2012-11-12T00:03:33Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aef2077
Parents:
e132b60
Message:

Fixed valgrind warnings in JSON_O_FOREACH.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/json_util.h

    re132b60 r67ebc8e  
    2626#define JSON_O_FOREACH(o, k, v) \
    2727        char *k; json_value *v; int __i; \
    28         for( __i = 0; k = (o)->u.object.values[__i].name, \
    29                       v = (o)->u.object.values[__i].value, \
    30                       __i < (o)->u.object.length; __i ++ )
     28        for( __i = 0; ( __i < (o)->u.object.length ) && \
     29                      ( k = (o)->u.object.values[__i].name ) && \
     30                      ( v = (o)->u.object.values[__i].value ); \
     31                      __i ++ )
    3132
    3233json_value *json_o_get( const json_value *obj, const json_char *name );
Note: See TracChangeset for help on using the changeset viewer.