From 0eb1166beb05f1880a3b9af8cb79bf5b242d50e9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Jan 2009 13:42:14 +0100 Subject: client: convert GREETING to a static string The length of GREETING is known at compile time, don't use strlen(). --- src/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3