Browse Source

#104 Fix eth_info MMJson_decode.

pass-iguana-arg
Artem Pikulin 7 years ago
parent
commit
4093b4b948
  1. 6
      crypto777/cJSON.c
  2. 10
      iguana/exchanges/LP_mmjson.c
  3. 2
      iguana/exchanges/LP_nativeDEX.c

6
crypto777/cJSON.c

@ -902,10 +902,10 @@ char *get_cJSON_fieldname(cJSON *obj)
{
if ( obj != 0 )
{
if ( obj->child != 0 && obj->child->string != 0 )
return(obj->child->string);
else if ( obj->string != 0 )
if ( obj->string != 0 )
return(obj->string);
if ( obj->child != 0 && obj->child->string != 0 )
return(obj->child->string);
}
return((char *)"<no cJSON string field>");
}

10
iguana/exchanges/LP_mmjson.c

@ -259,7 +259,15 @@ int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,
arbstr[j++] = c;
}
arbstr[j] = 0;
jaddstr(lineobj,fieldstr,arbstr);
#ifndef NOTETOMIC
if (strcmp(fieldstr, "eth_info") == 0) {
cJSON_AddItemToObject(lineobj, fieldstr, cJSON_Parse(arbstr));
} else {
#endif
jaddstr(lineobj, fieldstr, arbstr);
#ifndef NOTETOMIC
}
#endif
break;
default:
if ( valind < MMJSON_BOUNDARY )

2
iguana/exchanges/LP_nativeDEX.c

@ -1226,7 +1226,7 @@ void queue_loop(void *ctx)
}
if ( (json= cJSON_Parse((char *)ptr->msg)) != 0 )
{
if ( 1 && ptr->msglen < sizeof(linebuf) )
if ( ptr->msglen < sizeof(linebuf) )
{
if ( (k= MMJSON_encode(linebuf,(char *)ptr->msg)) > 0 )
{

Loading…
Cancel
Save