update_status_text bug fixed

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@732 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-08-25 11:26:15 +00:00
parent 45ed8c86f9
commit b2ce4105b8

View file

@ -1187,12 +1187,13 @@ void NSISCALL update_status_text_from_lang(langid_t id, const char *text2)
void NSISCALL update_status_text(const char *text1, const char *text2) void NSISCALL update_status_text(const char *text1, const char *text2)
{ {
static LVITEM new_item = {LVIF_TEXT,0,0,0,0,g_tmp}; static char tmp[NSIS_MAX_STRLEN];
static LVITEM new_item = {LVIF_TEXT,0,0,0,0,tmp};
RECT r; RECT r;
if (insthwnd) if (insthwnd)
{ {
if (mystrlen(text1)+mystrlen(text2) >= sizeof(g_tmp)) return; if (mystrlen(text1)+mystrlen(text2) >= sizeof(tmp)) return;
wsprintf(g_tmp,"%s%s",text1,text2); wsprintf(tmp,"%s%s",text1,text2);
if ((ui_st_updateflag&1)) if ((ui_st_updateflag&1))
{ {
// Changed by Amir Szekely 26th July 2002 // Changed by Amir Szekely 26th July 2002
@ -1202,7 +1203,7 @@ void NSISCALL update_status_text(const char *text1, const char *text2)
GetClientRect(insthwnd,&r); GetClientRect(insthwnd,&r);
ListView_SetColumnWidth(insthwnd, 0, r.right-r.left); ListView_SetColumnWidth(insthwnd, 0, r.right-r.left);
} }
if ((ui_st_updateflag&2)) SetWindowText(insthwnd2,ps_tmpbuf); if ((ui_st_updateflag&2)) SetWindowText(insthwnd2,tmp);
} }
} }