From 295adcf22215d2c46e92ecf6fb5c16dc7834b565 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 4 Jan 2022 02:31:41 +0300 Subject: [PATCH] engine: con_utils: don't also prepend backslash in autocompletion~ --- engine/common/con_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/common/con_utils.c b/engine/common/con_utils.c index c6b2cd3c..b07374e4 100644 --- a/engine/common/con_utils.c +++ b/engine/common/con_utils.c @@ -1216,7 +1216,7 @@ void Con_CompleteCommand( field_t *field ) if( con.matchCount == 1 ) { - Q_sprintf( con.completionField->buffer, "\\%s", con.cmds[0] ); + Q_strncpy( con.completionField->buffer, con.cmds[0], sizeof( con.completionField->buffer )); if( Cmd_Argc() == 1 ) Q_strncat( con.completionField->buffer, " ", sizeof( con.completionField->buffer ) ); else Con_ConcatRemaining( temp.buffer, con.completionString ); con.completionField->cursor = Q_strlen( con.completionField->buffer ); @@ -1244,7 +1244,7 @@ void Con_CompleteCommand( field_t *field ) con.shortestMatch[len] = 0; // multiple matches, complete to shortest - Q_sprintf( con.completionField->buffer, "\\%s", con.shortestMatch ); + Q_strncpy( con.completionField->buffer, con.shortestMatch, sizeof( con.completionField->buffer )); con.completionField->cursor = Q_strlen( con.completionField->buffer ); Con_ConcatRemaining( temp.buffer, con.completionString );