Browse Source

Test

etomic
jl777 7 years ago
parent
commit
1f775078da
  1. 2
      crypto777/OS_time.c
  2. 8
      iguana/dpow/dpow_prices.c

2
crypto777/OS_time.c

@ -596,7 +596,7 @@ int32_t conv_date(int32_t *secondsp,char *date)
sprintf(origdate,"%d-%02d-%02d",year,month,day); //2015-07-25T22:34:31Z
if ( strcmp(tmpdate,origdate) != 0 )
{
printf("conv_date date conversion error (%s) -> (%s) %d\n",origdate,date,year/min);
printf("conv_date date conversion error (%s) -> (%s)\n",origdate,date);
return(-1);
}
return((year * 10000) + (month * 100) + day);

8
iguana/dpow/dpow_prices.c

@ -1271,7 +1271,7 @@ int32_t PAX_ecbparse(char *date,double *prices,char *url,int32_t basenum)
char *jsonstr,*relstr,*basestr,name[16]; int32_t count=0,i,relnum; cJSON *json,*ratesobj,*item; struct destbuf tmp;
if ( (jsonstr= issue_curl(url)) != 0 )
{
if ( Debuglevel > 2 )
// if ( Debuglevel > 2 )
printf("(%s)\n",jsonstr);
if ( (json= cJSON_Parse(jsonstr)) != 0 )
{
@ -1322,7 +1322,7 @@ int32_t PAX_ecbprices(char *date,double *prices,int32_t year,int32_t month,int32
{
for (basenum=0; basenum<sizeof(CURRENCIES)/sizeof(*CURRENCIES); basenum++)
{
if ( strcmp(CURRENCIES[basenum],"XAU") == 0 )
if ( strcmp(CURRENCIES[basenum],"XAU") == 0 || i >= MAX_CURRENCIES )
break;
if ( iter == 0 )
{
@ -1330,7 +1330,7 @@ int32_t PAX_ecbprices(char *date,double *prices,int32_t year,int32_t month,int32
count += PAX_ecbparse(basenum == 0 ? date : tmpdate,prices,url,basenum);
if ( (basenum != 0 && strcmp(tmpdate,date) != 0) || (checkdate[0] != 0 && strcmp(checkdate,date) != 0) )
{
//printf("date mismatch (%s) != (%s) or checkdate.(%s)\n",tmpdate,date,checkdate);
printf("date mismatch (%s) != (%s) or checkdate.(%s)\n",tmpdate,date,checkdate);
return(-1);
}
}
@ -1338,7 +1338,7 @@ int32_t PAX_ecbprices(char *date,double *prices,int32_t year,int32_t month,int32
{
for (nonz=i=0; i<sizeof(CURRENCIES)/sizeof(*CURRENCIES); i++)
{
if ( strcmp(CURRENCIES[i],"XAU") == 0 )
if ( strcmp(CURRENCIES[i],"XAU") == 0 || i >= MAX_CURRENCIES )
break;
if ( prices[MAX_CURRENCIES*basenum + i] != 0. )
nonz++;

Loading…
Cancel
Save