From 1e093bacaef866b7ab99f9476e4fce34ab08429c Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 8 Nov 2022 02:55:09 +0000 Subject: [PATCH] Preserve trailing space in `": "` in a long message Previously, the `strcpy` would preserve the `:`, but overwrite the ` `. This is probably not what the player wants, since the first `": "` in the line can direct a message to specific recipients, but a bare `":"` will not. As a result, the old system would send the first part privately, but then mangle the directed-message prefix such that subsequent parts were sent publicly. Switch to preserve the trailing space so that the `": "` retains its special meaning in subsequent messages. --- similar/main/multi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/similar/main/multi.cpp b/similar/main/multi.cpp index 06e1a9976..012f549f9 100644 --- a/similar/main/multi.cpp +++ b/similar/main/multi.cpp @@ -1553,7 +1553,7 @@ window_event_result multi_message_input_sub(const d_robot_info_array &Robot_info multi_send_msgsend_state(msgsend_state::typing); auto pcolon = strstr(Network_message.data(), ": " ); if ( pcolon ) - strcpy( pcolon+1, ptext ); + strcpy( pcolon+2, ptext ); else strcpy(Network_message.data(), ptext); multi_message_index = strlen( Network_message );