client: convert GREETING to a static string
The length of GREETING is known at compile time, don't use strlen().
This commit is contained in:
parent
3dc43bb915
commit
0eb1166beb
@ -47,7 +47,7 @@
|
|||||||
#define G_LOG_DOMAIN "client"
|
#define G_LOG_DOMAIN "client"
|
||||||
#define LOG_LEVEL_SECURE G_LOG_LEVEL_INFO
|
#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_MODE_BEGIN "command_list_begin"
|
||||||
#define CLIENT_LIST_OK_MODE_BEGIN "command_list_ok_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();
|
client->permission = getDefaultPermissions();
|
||||||
|
|
||||||
xwrite(fd, GREETING, strlen(GREETING));
|
xwrite(fd, GREETING, sizeof(GREETING) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_cmd_list(GSList *list)
|
static void free_cmd_list(GSList *list)
|
||||||
|
Loading…
Reference in New Issue
Block a user