diff --git a/Contrib/InstallOptions/InstallerOptions.cpp b/Contrib/InstallOptions/InstallerOptions.cpp index 1d559b4b..81a78781 100644 --- a/Contrib/InstallOptions/InstallerOptions.cpp +++ b/Contrib/InstallOptions/InstallerOptions.cpp @@ -542,7 +542,7 @@ bool ReadSettings(void) { pFields[nIdx].nFlags |= LookupToken(FlagTable, szResult); pFields[nIdx].pszText = myGetProfileStringDup(szField, "TEXT"); - if (pFields[nIdx].nType == FIELD_LABEL) { + if (pFields[nIdx].nType == FIELD_LABEL && pFields[nIdx].pszText) { char *p1, *p2; for (p1=p2=pFields[nIdx].pszText; *p1; p1++, p2++) { if (*p1 == '\\') { @@ -722,14 +722,7 @@ BOOL CALLBACK cfgDlgProc(HWND hwndDlg, break; case WM_CTLCOLORSTATIC: case WM_CTLCOLORDLG: - { - COLORREF color = GetWindowLong((HWND)lParam, GWL_USERDATA); - if (color) { - LOGBRUSH b={BS_SOLID, color-1, 0}; - SetBkColor((HDC)wParam, b.lbColor); - return (BOOL)CreateBrushIndirect(&b); - } - } + return (BOOL)GetWindowLong((HWND)lParam, GWL_USERDATA); } return 0; } diff --git a/Plugins/InstallOptions.dll b/Plugins/InstallOptions.dll index 8ec8962d..476060cb 100644 Binary files a/Plugins/InstallOptions.dll and b/Plugins/InstallOptions.dll differ diff --git a/Source/lang.cpp b/Source/lang.cpp index 4cd85a0c..28409e57 100644 --- a/Source/lang.cpp +++ b/Source/lang.cpp @@ -86,8 +86,11 @@ StringTable* CEXEBuild::GetTable(LANGID &lang) { memset(table, 0, sizeof(StringTable)-sizeof(GrowBuf)*2); table->lang_id = lang; - table->user_strings.resize(build_userlangstrings.getnum()*sizeof(int), 1); - table->user_ustrings.resize(ubuild_userlangstrings.getnum()*sizeof(int), 1); + table->user_strings.set_zeroing(1); + table->user_ustrings.set_zeroing(1); + + table->user_strings.resize(build_userlangstrings.getnum()*sizeof(int)); + table->user_ustrings.resize(ubuild_userlangstrings.getnum()*sizeof(int)); string_tables.push_back(table); } @@ -236,8 +239,8 @@ int CEXEBuild::SetUserString(char *name, LANGID lang, char *string, int process/ if (string) user_strings_list->find(name, 0, &idx); unsigned int new_size = user_strings_list->getnum() * sizeof(int); for (unsigned int i = 0; i < string_tables.size(); i++) { - if (uninst) string_tables[i]->user_ustrings.resize(new_size, 1); - else string_tables[i]->user_strings.resize(new_size, 1); + if (uninst) string_tables[i]->user_ustrings.resize(new_size); + else string_tables[i]->user_strings.resize(new_size); } } diff --git a/Source/strlist.h b/Source/strlist.h index d281fdbe..d561ccb3 100644 --- a/Source/strlist.h +++ b/Source/strlist.h @@ -7,7 +7,7 @@ class IGrowBuf { public: virtual int add(const void *data, int len)=0; - virtual void resize(int newlen, int zero=0)=0; + virtual void resize(int newlen)=0; virtual int getlen()=0; virtual void *get()=0; }; @@ -15,9 +15,11 @@ class IGrowBuf class GrowBuf : public IGrowBuf { public: - GrowBuf() { m_alloc=m_used=0; m_s=NULL; } + GrowBuf() { m_alloc=m_used=m_zero=0; m_s=NULL; } ~GrowBuf() { free(m_s); } + void set_zeroing(int zero) { m_zero=zero; } + int add(const void *data, int len) { if (len<=0) return 0; @@ -26,7 +28,7 @@ class GrowBuf : public IGrowBuf return m_used-len; } - void resize(int newlen, int zero=0) + void resize(int newlen) { int os=m_alloc; int ou=m_used; @@ -61,7 +63,7 @@ class GrowBuf : public IGrowBuf free(m_s); } m_s=n; - if (zero) memset((char*)m_s+ou,0,m_used-ou); + if (m_zero) memset((char*)m_s+ou,0,m_alloc-ou); } if (!m_used && m_alloc > 65535) // only free if you resize to 0 and we're > 64k { @@ -78,7 +80,7 @@ class GrowBuf : public IGrowBuf void *m_s; int m_alloc; int m_used; - + int m_zero; }; class StringList @@ -229,7 +231,7 @@ class MMapBuf : public IGrowBuf return getlen()-len; } - void resize(int newlen, int zero=0) + void resize(int newlen) { if (!m_gb_u && newlen < (16<<20)) // still in db mode {