From 07fb70a4a395ab929f92c125e37bee6d6507c09e Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 17 Feb 2022 19:29:04 +0100 Subject: [PATCH] [bittorrent] const in get_peer_message --- src/protocol/bittorrent/common.c | 4 ++-- src/protocol/bittorrent/common.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/protocol/bittorrent/common.c b/src/protocol/bittorrent/common.c index a941952e8..49b445d2b 100644 --- a/src/protocol/bittorrent/common.c +++ b/src/protocol/bittorrent/common.c @@ -56,12 +56,12 @@ get_peer_id(bittorrent_id_T peer_id) return hex; } -char * +const char * get_peer_message(bittorrent_message_id_T message_id) { static struct { bittorrent_message_id_T message_id; - char *name; + const char *name; } messages[] = { { BITTORRENT_MESSAGE_INCOMPLETE, "incomplete" }, { BITTORRENT_MESSAGE_KEEP_ALIVE, "keep-alive" }, diff --git a/src/protocol/bittorrent/common.h b/src/protocol/bittorrent/common.h index 73d356337..a605cc0b2 100644 --- a/src/protocol/bittorrent/common.h +++ b/src/protocol/bittorrent/common.h @@ -399,7 +399,7 @@ void done_bittorrent_message(struct bittorrent_message *message); /* ************************************************************************** */ char *get_peer_id(bittorrent_id_T peer); -char *get_peer_message(bittorrent_message_id_T message_id); +const char *get_peer_message(bittorrent_message_id_T message_id); /* ************************************************************************** */ /* Peer request management: */