Fixed incorrect usages of std::swprintf()

This commit is contained in:
RElesgoe 2016-08-24 00:46:54 -07:00
parent cc496b2fbd
commit 8c2c82a162
3 changed files with 3 additions and 3 deletions

View file

@ -60,7 +60,7 @@ namespace pvpgn
fmt.yHeight = 160;
fmt.dwEffects = 0;
fmt.crTextColor = clr;
std::swprintf(fmt.szFaceName, sizeof fmt.szFaceName, L"%ls", L"Courier New");
std::swprintf(fmt.szFaceName, sizeof fmt.szFaceName / sizeof *fmt.szFaceName, L"%ls", L"Courier New");
SendMessageW(ghwndConsole, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&fmt);
SendMessageA(ghwndConsole, EM_REPLACESEL, FALSE, (LPARAM)str);

View file

@ -21,7 +21,7 @@
#ifndef PVPGN_VERSION
#define PVPGN_VERSION "1.99.7-PRO"
#define PVPGN_VERSIONW WIDEN(PVPGN_VERSIONW)
#define PVPGN_VERSIONW WIDEN(PVPGN_VERSION)
#endif
#ifndef PVPGN_SOFTWARE

View file

@ -432,7 +432,7 @@ namespace pvpgn
dta.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
dta.uCallbackMessage = WM_SHELLNOTIFY;
dta.hIcon = LoadIconW(GetWindowInstance(hwnd), MAKEINTRESOURCE(IDI_ICON1));
std::swprintf(dta.szTip, sizeof dta.szTip / sizeof *dta.szTip, L"%ls %ls", PVPGN_SOFTWAREW, PVPGN_VERSION);
std::swprintf(dta.szTip, sizeof dta.szTip / sizeof *dta.szTip, L"%ls %ls", PVPGN_SOFTWAREW, PVPGN_VERSIONW);
Shell_NotifyIconW(NIM_ADD, &dta);
ShowWindow(hwnd, SW_HIDE);
return;