Index: src/ui/ui_shared.c =================================================================== --- src/ui/ui_shared.c (revision 1094) +++ src/ui/ui_shared.c (working copy) @@ -4542,9 +4542,9 @@ static const char *Item_Text_Wrap( const char *text, float scale, float width ) { - static char out[ 8192 ]; + static char out[ 8192 ] = { 0 }; char *paint = out; - char c[ 3 ]; + char c[ 3 ] = { 0 }; const char *p = text; const char *eol; const char *q = NULL, *qMinus1 = NULL; @@ -4560,8 +4560,6 @@ while( *p ) { - Com_Memset( c, 0, sizeof( c ) ); - // Skip leading whitespace while( *p ) @@ -4581,11 +4579,13 @@ if( !*p ) break; + Q_strcat( paint, out + sizeof( out ) - paint, c ); + testLength = 1; eol = p; - q = p; + q = p + 1; while( Q_IsColorString( q ) ) { @@ -4594,15 +4594,6 @@ q += 2; } - q++; - - while( Q_IsColorString( q ) ) - { - c[ 0 ] = q[ 0 ]; - c[ 1 ] = q[ 1 ]; - q += 2; - } - while( UI_Text_Width( p, scale, testLength ) < width ) { if( testLength >= strlen( p ) )