diff options
author | Max Kellermann <max@duempel.org> | 2012-08-08 09:15:34 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-08 09:27:12 +0200 |
commit | 21792386d835903d2f9e2d04a1860d60bb8488e2 (patch) | |
tree | 572cd68b4684b0a03207907dfc96a5c5e2651aa2 /src/command.c | |
parent | 63a2ac21e1d8190448057fbf24d5ab948d3daff8 (diff) | |
download | mpd-21792386d835903d2f9e2d04a1860d60bb8488e2.tar.gz mpd-21792386d835903d2f9e2d04a1860d60bb8488e2.tar.xz mpd-21792386d835903d2f9e2d04a1860d60bb8488e2.zip |
time_print: new library, function time_print()
Implements error checking for the gmtime_r() call, which was missing
in two code locations.
Diffstat (limited to 'src/command.c')
-rw-r--r-- | src/command.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/command.c b/src/command.c index adda734c9..0856589b0 100644 --- a/src/command.c +++ b/src/command.c @@ -30,6 +30,7 @@ #include "playlist_queue.h" #include "playlist_error.h" #include "queue_print.h" +#include "time_print.h" #include "ls.h" #include "uri.h" #include "decoder_print.h" @@ -115,25 +116,10 @@ print_spl_list(struct client *client, GPtrArray *list) for (unsigned i = 0; i < list->len; ++i) { struct stored_playlist_info *playlist = g_ptr_array_index(list, i); - time_t t; -#ifndef WIN32 - struct tm tm; -#endif - char timestamp[32]; client_printf(client, "playlist: %s\n", playlist->name); - t = playlist->mtime; - strftime(timestamp, sizeof(timestamp), -#ifdef G_OS_WIN32 - "%Y-%m-%dT%H:%M:%SZ", - gmtime(&t) -#else - "%FT%TZ", - gmtime_r(&t, &tm) -#endif - ); - client_printf(client, "Last-Modified: %s\n", timestamp); + time_print(client, "Last-Modified", playlist->mtime); } } |