mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 18:05:21 -04:00
[misc] fix PVS-Studio static analyzer warnings
* Surround macro params to ensure expected results * Fix copy-paste errors * Fix a potential buffer overflow in SetSectionHeaders() * Add const modifier where relevant * Use GetWindowLongPtr() everywhere * Use proper sprintf format for unsigned int * Use %s for printf-like funcs (https://www.viva64.com/en/w/v618/print/) * Closes #1464
This commit is contained in:
parent
e0bc2e5ffd
commit
121257c584
10 changed files with 27 additions and 27 deletions
10
src/ui.c
10
src/ui.c
|
@ -149,7 +149,7 @@ void GetMainButtonsWidth(HWND hDlg)
|
|||
{
|
||||
unsigned int i;
|
||||
RECT rc;
|
||||
LONG style;
|
||||
LONG_PTR style;
|
||||
char download[64];
|
||||
|
||||
GetWindowRect(GetDlgItem(hDlg, main_button_ids[0]), &rc);
|
||||
|
@ -167,9 +167,9 @@ void GetMainButtonsWidth(HWND hDlg)
|
|||
static_strcpy(download, lmprintf(MSG_040));
|
||||
CharUpperBuffU(download, sizeof(download));
|
||||
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDC_SELECT), download).cx + (3 * cbw) / 2);
|
||||
style = GetWindowLong(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE);
|
||||
style|= BS_SPLITBUTTON;
|
||||
SetWindowLong(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE, style);
|
||||
style = GetWindowLongPtr(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE);
|
||||
style |= BS_SPLITBUTTON;
|
||||
SetWindowLongPtr(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE, style);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -561,7 +561,7 @@ void SetSectionHeaders(HWND hDlg)
|
|||
SendDlgItemMessageA(hDlg, section_control_ids[i], WM_SETFONT, (WPARAM)hf, TRUE);
|
||||
hCtrl = GetDlgItem(hDlg, section_control_ids[i]);
|
||||
memset(wtmp, 0, sizeof(wtmp));
|
||||
GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp));
|
||||
GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp) - 3);
|
||||
wlen = wcslen(wtmp);
|
||||
wtmp[wlen++] = L' ';
|
||||
wtmp[wlen++] = L' ';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue