aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-03 13:42:14 +0100
committerMax Kellermann <max@duempel.org>2009-01-03 13:42:14 +0100
commit0eb1166beb05f1880a3b9af8cb79bf5b242d50e9 (patch)
treee21f4647e8550aa0a3b8017ed4575d9cc2efabd5 /src/client.c
parent3dc43bb915f5e0645d68601573988e122bb16dd1 (diff)
downloadmpd-0eb1166beb05f1880a3b9af8cb79bf5b242d50e9.tar.gz
mpd-0eb1166beb05f1880a3b9af8cb79bf5b242d50e9.tar.xz
mpd-0eb1166beb05f1880a3b9af8cb79bf5b242d50e9.zip
client: convert GREETING to a static string
The length of GREETING is known at compile time, don't use strlen().
Diffstat (limited to '')
-rw-r--r--src/client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client.c b/src/client.c
index 02d35cc4f..b31761ba0 100644
--- a/src/client.c
+++ b/src/client.c
@@ -47,7 +47,7 @@
#define G_LOG_DOMAIN "client"
#define LOG_LEVEL_SECURE G_LOG_LEVEL_INFO
-#define GREETING "OK MPD " PROTOCOL_VERSION "\n"
+static const char GREETING[] = "OK MPD " PROTOCOL_VERSION "\n";
#define CLIENT_LIST_MODE_BEGIN "command_list_begin"
#define CLIENT_LIST_OK_MODE_BEGIN "command_list_ok_begin"
@@ -202,7 +202,7 @@ static void client_init(struct client *client, int fd)
client->permission = getDefaultPermissions();
- xwrite(fd, GREETING, strlen(GREETING));
+ xwrite(fd, GREETING, sizeof(GREETING) - 1);
}
static void free_cmd_list(GSList *list)