diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 05d092e93..cc81ff5c9 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -4061,9 +4061,7 @@ void Finder::add(FoundInfo fi, SearchResultMarking mi, const TCHAR* foundline) str += _prefixLineStr; str += TEXT(" "); - TCHAR lnb[16]; - wsprintf(lnb, TEXT("%d"), static_cast(fi._lineNumber)); - str += lnb; + str += std::to_wstring(fi._lineNumber); str += TEXT(": "); mi._start += str.length(); mi._end += str.length(); diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index b21b84e70..f862d351d 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -21,6 +21,7 @@ #include "shortcut.h" #include "Parameters.h" #include "Notepad_plus.h" +#include void Command::extractArgs(TCHAR* cmd2Exec, size_t cmd2ExecLen, TCHAR* args, size_t argsLen, const TCHAR* cmdEntier) @@ -145,8 +146,9 @@ void expandNppEnvironmentStrs(const TCHAR *strSrc, TCHAR *stringDest, size_t str TCHAR expandedStr[CURRENTWORD_MAXLENGTH] = { '\0' }; if (internalVar == CURRENT_LINE || internalVar == CURRENT_COLUMN) { - int lineNumber = static_cast(::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, 0, 0)); - wsprintf(expandedStr, TEXT("%d"), lineNumber); + size_t lineNumber = ::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, 0, 0); + std::wstring lineNumStr = std::to_wstring(lineNumber); + StringCchCopyW(expandedStr, CURRENTWORD_MAXLENGTH, lineNumStr.c_str()); } else ::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, CURRENTWORD_MAXLENGTH, reinterpret_cast(expandedStr));