File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ void CConsole::DrawBackgrounds( bool bGame )
438438 if ( m_select_tip < (int )m_tips.size () )
439439 {
440440 Frect r;
441-
441+ xr_string tmp;
442442 vecTipsEx::iterator itb = m_tips.begin () + m_start_tip;
443443 vecTipsEx::iterator ite = m_tips.end ();
444444 for ( u32 i = 0 ; itb != ite; ++itb, ++i ) // tips
@@ -455,14 +455,12 @@ void CConsole::DrawBackgrounds( bool bGame )
455455 }
456456
457457 r.null ();
458- LPSTR tmp = (PSTR)_alloca ( (str_size + 1 ) * sizeof (char ) );
459-
460- strncpy_s ( tmp, str_size+1 , ts.text .c_str (), ts.HL_start );
461- r.x1 = pr.x1 + w1 + pFont->SizeOf_ ( tmp );
458+ tmp.assign (ts.text .c_str (), ts.HL_start );
459+ r.x1 = pr.x1 + w1 + pFont->SizeOf_ ( tmp.c_str () );
462460 r.y1 = pr.y1 + i * font_h;
463461
464- strncpy_s ( tmp, str_size+ 1 , ts.text .c_str (), ts.HL_finish );
465- r.x2 = pr.x1 + w1 + pFont->SizeOf_ ( tmp );
462+ tmp. assign ( ts.text .c_str (), ts.HL_finish );
463+ r.x2 = pr.x1 + w1 + pFont->SizeOf_ ( tmp. c_str () );
466464 r.y2 = r.y1 + font_h;
467465
468466 DrawRect ( r, tips_word_color );
You can’t perform that action at this time.
0 commit comments