summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/run_storage.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/run_storage.cxx b/test/run_storage.cxx
index 99992c3b8..805211fe0 100644
--- a/test/run_storage.cxx
+++ b/test/run_storage.cxx
@@ -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,