mirror of https://github.com/xzeldon/htop.git
Use reentrant version to silence warnings.
This commit is contained in:
parent
4027e5ee44
commit
f5a469b5a8
|
@ -21,7 +21,8 @@ int ClockMeter_attributes[] = {
|
||||||
|
|
||||||
static void ClockMeter_setValues(Meter* this, char* buffer, int size) {
|
static void ClockMeter_setValues(Meter* this, char* buffer, int size) {
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
struct tm *lt = localtime(&t);
|
struct tm result;
|
||||||
|
struct tm *lt = localtime_r(&t, &result);
|
||||||
this->values[0] = lt->tm_hour * 60 + lt->tm_min;
|
this->values[0] = lt->tm_hour * 60 + lt->tm_min;
|
||||||
strftime(buffer, size, "%H:%M:%S", lt);
|
strftime(buffer, size, "%H:%M:%S", lt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue