mirror of
https://github.com/0intro/wmii
synced 2025-01-22 10:02:23 +03:00
changed str_of_time in wmiir.c
This commit is contained in:
parent
c3302b5577
commit
60db995b44
10
cmd/wmiir.c
10
cmd/wmiir.c
@ -121,14 +121,12 @@ str_of_mode(unsigned int mode)
|
||||
}
|
||||
|
||||
static char *
|
||||
str_of_time(unsigned int t)
|
||||
str_of_time(unsigned int val)
|
||||
{
|
||||
static char buf[32];
|
||||
struct timeval tv = {0};
|
||||
|
||||
tv.tv_sec = t;
|
||||
char *tstr = ctime(&tv.tv_sec);
|
||||
cext_strlcpy(buf, tstr ? tstr : "invalid ", sizeof(buf));
|
||||
time_t t = (time_t)(int)val;
|
||||
char *tstr = ctime(&t);
|
||||
cext_strlcpy(buf, tstr ? tstr : "in v a l id ", sizeof(buf));
|
||||
buf[strlen(buf) - 1] = 0;
|
||||
return buf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user