char* ret = "json_parse_json_bool(): truncated bool";
- if( *index >= (current_strlen - 5))
+ if( *index > (current_strlen - 4))
return json_handle_error(string, index, ret);
-
- if(!strncasecmp( string + (*index), "false", 5)) {
- (*index) += 5;
- obj->value.b = 0;
+
+ if(!strncasecmp( string + (*index), "true", 4)) {
+ (*index) += 4;
+ obj->value.b = 1;
obj->type = JSON_BOOL;
return 0;
}
- if( *index >= (current_strlen - 4))
+ if( *index > (current_strlen - 5))
return json_handle_error(string, index, ret);
-
- if(!strncasecmp( string + (*index), "true", 4)) {
- (*index) += 4;
- obj->value.b = 1;
+
+ if(!strncasecmp( string + (*index), "false", 5)) {
+ (*index) += 5;
+ obj->value.b = 0;
obj->type = JSON_BOOL;
return 0;
}