1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 14:58:01 +00:00

These may not be longs (eg: OSX)... fo a safe cast to ensure.

This commit is contained in:
Jim Jagielski 2014-02-03 08:13:14 -05:00 committed by Noel Maersk
parent a1844cdf44
commit 88c7720caf

6
api.c
View File

@ -1005,9 +1005,9 @@ static struct api_data *print_data(struct api_data *root, char *buf, bool isjson
sprintf(buf, "%s", *((bool *)(root->data)) ? TRUESTR : FALSESTR);
break;
case API_TIMEVAL:
sprintf(buf, "%ld.%06ld",
((struct timeval *)(root->data))->tv_sec,
((struct timeval *)(root->data))->tv_usec);
snprintf(buf, sizeof(buf), "%ld.%06ld",
(long)((struct timeval *)(root->data))->tv_sec,
(long)((struct timeval *)(root->data))->tv_usec);
break;
case API_TEMP:
sprintf(buf, "%.2f", *((float *)(root->data)));