test/run_storage: don't print unknown time stamps

This commit is contained in:
Max Kellermann 2017-01-08 10:22:25 +01:00
parent 44493ca0c4
commit 78c91e9e5b

View File

@ -67,8 +67,13 @@ Ls(Storage &storage, const char *path)
break;
}
char mtime[32];
strftime(mtime, sizeof(mtime), "%F", gmtime(&info.mtime));
char mtime_buffer[32];
const char *mtime = " ";
if (info.mtime > 0) {
strftime(mtime_buffer, sizeof(mtime_buffer), "%F",
gmtime(&info.mtime));
mtime = mtime_buffer;
}
printf("%s %10llu %s %s\n",
type, (unsigned long long)info.size,