From d09c89a149c614da529fd1933c9d8e8c0db4e985 Mon Sep 17 00:00:00 2001 From: Tobias Rehbein Date: Thu, 17 Feb 2011 21:40:43 +0100 Subject: [PATCH] Standardize mpd.c Feature check macro #define _POSIX_C_SOURCE 199506 has been applied to mpd.c to make sure that no non-standard functions are used. --- mpd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mpd.c b/mpd.c index 41fc73a..6d6a210 100644 --- a/mpd.c +++ b/mpd.c @@ -6,6 +6,8 @@ * Tobias Rehbein */ +#define _POSIX_C_SOURCE 199506 + #include #include #include @@ -24,6 +26,7 @@ #include "buffers.h" #include "mpd.h" +#include "tools.h" enum { SLEEP = 5, @@ -125,7 +128,7 @@ mpd_str(struct mpd_context *ctx) if ((title = mpd_song_get_tag(song, MPD_TAG_TITLE, 0)) == NULL) title = NOTITLE; - inleft = snprintf(ctx->mpd_utf, sizeof(ctx->mpd_utf), "%s - %s", artist, title); + inleft = tools_catitems(ctx->mpd_utf, sizeof(ctx->mpd_utf), artist, " - ", title, NULL); inleft = inleft < sizeof(ctx->mpd_utf) ? inleft : (sizeof(ctx->mpd_utf) - 1); outleft = sizeof(ctx->mpd_str); -- 2.11.4.GIT