mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 12:34:27 +00:00
API: Fixed timeval struct formatting .
This commit is contained in:
parent
e7fbdf3f7a
commit
25242861c7
6
api.c
6
api.c
@ -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);
|
sprintf(buf, "%s", *((bool *)(root->data)) ? TRUESTR : FALSESTR);
|
||||||
break;
|
break;
|
||||||
case API_TIMEVAL:
|
case API_TIMEVAL:
|
||||||
snprintf(buf, sizeof(buf), "%ld.%06ld",
|
snprintf(buf, sizeof(buf), "%"PRIu64".%06lu",
|
||||||
(long)((struct timeval *)(root->data))->tv_sec,
|
(uint64_t)((struct timeval *)(root->data))->tv_sec,
|
||||||
(long)((struct timeval *)(root->data))->tv_usec);
|
(unsigned long)((struct timeval *)(root->data))->tv_usec);
|
||||||
break;
|
break;
|
||||||
case API_TEMP:
|
case API_TEMP:
|
||||||
sprintf(buf, "%.2f", *((float *)(root->data)));
|
sprintf(buf, "%.2f", *((float *)(root->data)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user