diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-08 10:22:25 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-08 10:41:08 +0100 |
commit | 78c91e9e5b63adb191ab537fcc811602f90516a5 (patch) | |
tree | 2b3e36a2a4273fb36b5c8fa1846e425e06a5beab /test | |
parent | 44493ca0c4d32c78d185c998dc6d2f5e504f780c (diff) |
test/run_storage: don't print unknown time stamps
Diffstat (limited to 'test')
-rw-r--r-- | test/run_storage.cxx | 9 |
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, |