From 19cfaac52ecbd54924e4ee77c6ca1c4e166fcb47 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 30 Jan 2012 10:33:07 +0000 Subject: [PATCH] c-string are not writable --- applications/jpip/libopenjpip/imgsock_manager.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/applications/jpip/libopenjpip/imgsock_manager.c b/applications/jpip/libopenjpip/imgsock_manager.c index 38867c1b..56bbea09 100644 --- a/applications/jpip/libopenjpip/imgsock_manager.c +++ b/applications/jpip/libopenjpip/imgsock_manager.c @@ -40,7 +40,9 @@ msgtype_t identify_clientmsg( SOCKET connected_socket) { int receive_size; char buf[BUF_LEN]; - char *magicid[] = { "JPIP-stream", "PNM request", "XML request", "TID request", "CID request", "CID destroy", "SIZ request", "JP2 save", "QUIT"}; + static const char *magicid[] = { "JPIP-stream", "PNM request", "XML request", + "TID request", "CID request", "CID destroy", "SIZ request", "JP2 save", + "QUIT"}; int i; receive_size = receive_line( connected_socket, buf); @@ -125,7 +127,7 @@ void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, int length) send_stream( connected_socket, xmlstream, length); } -void send_IDstream( SOCKET connected_socket, char *id, int idlen, char *label); +void send_IDstream( SOCKET connected_socket, char *id, int idlen, const char *label); void send_CIDstream( SOCKET connected_socket, char *cid, int cidlen) { @@ -137,7 +139,7 @@ void send_TIDstream( SOCKET connected_socket, char *tid, int tidlen) send_IDstream( connected_socket, tid, tidlen, "TID"); } -void send_IDstream( SOCKET connected_socket, char *id, int idlen, char *label) +void send_IDstream( SOCKET connected_socket, char *id, int idlen, const char *label) { Byte_t header[4];