notepad: Use the ARRAY_SIZE() macro if we already have it.
This commit is contained in:
parent
cdc5b0c29b
commit
129889b287
|
@ -257,7 +257,7 @@ void DoOpenFile(LPCWSTR szFileName)
|
|||
SetFocus(Globals.hEdit);
|
||||
|
||||
/* If the file starts with .LOG, add a time/date at the end and set cursor after */
|
||||
if (GetWindowTextW(Globals.hEdit, log, sizeof(log)/sizeof(log[0])) && !lstrcmpW(log, dotlog))
|
||||
if (GetWindowTextW(Globals.hEdit, log, ARRAY_SIZE(log)) && !lstrcmpW(log, dotlog))
|
||||
{
|
||||
static const WCHAR lfW[] = { '\r','\n',0 };
|
||||
SendMessageW(Globals.hEdit, EM_SETSEL, GetWindowTextLengthW(Globals.hEdit), -1);
|
||||
|
|
|
@ -203,10 +203,10 @@ static VOID NOTEPAD_LoadSettingFromRegistry(void)
|
|||
Globals.lfFont.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
|
||||
lstrcpyW(Globals.lfFont.lfFaceName, systemW);
|
||||
|
||||
LoadStringW(Globals.hInstance, STRING_PAGESETUP_HEADERVALUE, Globals.szHeader,
|
||||
sizeof(Globals.szHeader) / sizeof(Globals.szHeader[0]));
|
||||
LoadStringW(Globals.hInstance, STRING_PAGESETUP_FOOTERVALUE, Globals.szFooter,
|
||||
sizeof(Globals.szFooter) / sizeof(Globals.szFooter[0]));
|
||||
LoadStringW(Globals.hInstance, STRING_PAGESETUP_HEADERVALUE,
|
||||
Globals.szHeader, ARRAY_SIZE(Globals.szHeader));
|
||||
LoadStringW(Globals.hInstance, STRING_PAGESETUP_FOOTERVALUE,
|
||||
Globals.szFooter, ARRAY_SIZE(Globals.szFooter));
|
||||
|
||||
if(RegOpenKeyW(HKEY_CURRENT_USER, notepad_reg_key, &hkey) == ERROR_SUCCESS)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue