Skip to content

Commit

Permalink
#104 Fix eth_info MMJson_decode.
Browse files Browse the repository at this point in the history
  • Loading branch information
artemii235 committed Jul 23, 2018
1 parent a7e4f58 commit 4093b4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crypto777/cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>");
}
Expand Down
10 changes: 9 additions & 1 deletion iguana/exchanges/LP_mmjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion iguana/exchanges/LP_nativeDEX.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 4093b4b

Please sign in to comment.