ctime vs mtime fix

This commit is contained in:
p.kosyh 2010-07-13 04:40:38 +00:00
parent 94f147e0e3
commit 5392162de8

View file

@ -74,7 +74,7 @@ static char *slot_name(const char *path)
time(&t); time(&t);
tm = localtime(&t); tm = localtime(&t);
y = tm->tm_year; y = tm->tm_year;
tm = localtime(&st.st_ctime); tm = localtime(&st.st_mtime);
l = malloc(strlen(s) + 64); l = malloc(strlen(s) + 64);
if (!l) if (!l)
return s; return s;
@ -94,7 +94,7 @@ static char *slot_name(const char *path)
} }
free(l); free(l);
} }
l = ctime(&st.st_ctime); l = ctime(&st.st_mtime);
if (!l) if (!l)
return NULL; return NULL;
l[strcspn(l,"\n")] = 0; l[strcspn(l,"\n")] = 0;